|
Hi All,
With this below code i am able to print the datagrid. The problem now is i am able to print only part of the data grid, that too first page as empty, second page with part of the content and third page again empty.. What might be the reason.. I am able to scroll through the datagrid .. How can i print the entire datagrid.. Please anyone help me..
here i am sending Datagrid object to strid..
<script language=javascript>
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
prtContent.innerHTML=strOldOne;
}
</script>
Thanks n Regards,
Umashanker.K
|
|
|
|
|
Are all your columns fitting on one page? You might get some weird printing truncating of columns if they don't fit on one page. Another question is if you have paging turned on. You would need to turn paging off so that all the rows show up.
Hope that helps.
Ben
|
|
|
|
|
Hi kubben, As u see my previous question my problem here is i am not able to print in continous order,even i am able to view the contends of the grid with scoll bar help..While printingand print preview the problem comes , how can i rectify. If i give window.print() for whole of the main page, not specifying the grid alone i am able to print the whole screen with other grid in the pages too.. plzz help a fessible solution for this.
Thanks & Regards
umashanker.k
|
|
|
|
|
You know it might be a good idea to see what sort of html doc you are creating.
Change your script to look like this:
<script language=javascript>
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=0,top=0,width=800,height=600,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
prtContent.innerHTML=strOldOne;
}
</script>
So now the new window is larger and you can view the source to see what the html looks like.
I am guessing that the what you are writing to the page with you document.write isn't exaclt what you want.
Ben
|
|
|
|
|
Still the problem exists ben.. i even changed scrollbar setting too.. but then the same problem comes.. any suggestions
Rgrds
umashanker
|
|
|
|
|
If printing the whole page works. And printing part of the page does not work. Then issue is in the html. So you should be able to view the source of the full page and then view the source of the part of the page you are trying to print. You should be able to see the differences in the html which should help in why the part of the page isn't printing. without seeing the html it would be hard to say what is going on.
You may be missing some tags.
Ben
|
|
|
|
|
hello
How to implement remember me next time feature for login control in asp.net 2.0. if anyone knows plz give some idea.
bye
|
|
|
|
|
Login Control: builtin control for user autentication in it there is two textboxes(UserName and Password) and one CheckBox("Remember me next time") and a button(Login).
the Remember me next time check box is not working bydefault. i m doing that in my way below is the code for Working "Remember me next time" checkbox.
first we have to put login control on page like below
<asp:login id="Login1" runat="server" onloggedin="Login1_LoggedIN">
then do this code on Login1_LoggedIN Event like below
protected void Login1_LoggedIN(object sender, EventArgs e)
{
CheckBox rm = (CheckBox)Login1.FindControl("RememberMe");
if (rm.Checked)
{
HttpCookie myCookie = new HttpCookie("myCookie");
Response.Cookies.Remove("myCookie");
Response.Cookies.Add(myCookie);
myCookie.Values.Add("Email", this.Login1.UserName.ToString());
myCookie.Values.Add("Pass", this.Login1.Password.ToString());
DateTime dtExpiry = DateTime.Now.AddDays(15); //you can add years and months too here
Response.Cookies["myCookie"].Expires = dtExpiry;
}
}
and then do this code on Page_Load Event
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.Cookies["myCookie"] != null)
{
HttpCookie cookie = Request.Cookies.Get("myCookie");
string emailID = cookie.Values["Email"].ToString();
string password = cookie.Values["Pass"].ToString();
if (Membership.ValidateUser(emailID, password))
{
FormsAuthentication.RedirectFromLoginPage(emailID, true);
}
}
}
}
think its useful for u
i find this code from codeproject only......
bye
naresh.s.s
|
|
|
|
|
thanx for ur help. but i am confused that in this code where is the connectivity with database where we can check user name and pwd in database table. Which user name and pwd should be given to login for this code. When i give any user name and pwd it will give me error like "Your login attempt was not successful. Please try again."
Plz help me out for this.
bye
|
|
|
|
|
nareshss wrote: the Remember me next time check box is not working bydefault
It is?
only two letters away from being an asset
|
|
|
|
|
yes it is not working bydefault. what to make it working ? any code is there?
plz if you have idea then post it
|
|
|
|
|
hello,
How to store this user name and password in encrypted format in cookie?
bye
|
|
|
|
|
The Article by Britney S. Morales Here[^] will help you.
Regards,
Satips.
|
|
|
|
|
Hi All I m new to asp.net.
I want to create a page on which different images are displayed. It will work like remote control. There will b a main Image. And in the lower part of the page there will be other images. I want to swap the main image with the other one when some one click on image in the lower part. Please give me any link, where I can start.
|
|
|
|
|
Maybe something like the below?
Fred
<html>
<head>
<script language="javascript">
<!--
function swapImage(i) {
mainPic.src = i.src;
}
// -->
</script>
</head>
<body>
<img id="mainPic" src="default.jpg">
<br><br>
<img src="image1.jpg" width="100" height="100" onclick="swapImage(this);">
<img src="image2.jpg" width="100" height="100" onclick="swapImage(this);">
<img src="image3.jpg" width="100" height="100" onclick="swapImage(this);">
</body></html>
|
|
|
|
|
Thank u dear,
It realy help me.
|
|
|
|
|
i have created a web application in c# and ASP.NET1.1 that is having a button on click of which
spawns a web page which is hosted on my localhost!
i have given the URL to my friend.Now he/she access it .
I want a alert box or some notification on my local computer that the webpage from my localhost
is being accessed.
Is it possible with .NET 1.1 ?
If yes, how?
Thanks in advance
|
|
|
|
|
I dont know how you get an alert window if some one browsing your url from his/her PC. but try the following, you just copy and paste the following into your web.config file.
<trace enabled="true" requestlimit="10" pageoutput="false" tracemode="SortByTime">save the file. then ask your friend to browse the URL which you given. after that, your browse the URL like: http://localhost/yourapp?trace.axd
Karthik
|
|
|
|
|
now where i get the traced thing?
i m not getting anything .
Can u please u explain in a bit detail?
Thanks
|
|
|
|
|
if you are followed the steps properly. you will see the trace details by entering the following URL:
http://localhost/yourappname?trace.axd
suppose my virtual directory name is "bhavna" the URL would be:
http://localhost/bhavna?trace.axd
remember you did not mention your page name here.
Karthik
|
|
|
|
|
see i have created a web application which is having a button.
On button click i coded
Response.Redirect("http://mycomputername/abc.php");
which opens a php page on button click
Now i have given this link to someone else
http://mycomputername/Popalert/webForm1.aspx
and turned trace to true.
when i accessed
http://mycomputername/Popalert/webForm1.aspx?trace.axd
i got nothing but the page which is the webform.
No trace i got
|
|
|
|
|
|
i got the traced output but can't we give an alert box in local comp that
the web page is accessed
Can we do this?
|
|
|
|
|
I dont know how to popup a message box when the end-user requesting the page. i will send a mail to you once i got the solution.
Karthik
|
|
|
|
|
ok thanks!
so nice of u!
please mail me if u get the solution
thanks for quick response
|
|
|
|