kkonkle
Member
Im fairly new to ASP.Net 2.0 and I have a couple (probably simple) questions.
I did some searching on this forum, and the tutorials and code library sections too, but didnt find what I needed.
Searching google just turned up a lot of sites about how to make a printer friendly version of your page, but not how to actually print.
1) How do I add a button to my page to print my aspx page? I dont need to pretty up the page, or move any controls or anything, I just want to pop up the print dialog and let the user print the page.
Looks like the most common thing to do is "window.print()", but Visual Studio doesnt like that. I have an "ASP:Button" control and in its "OnClick" property I tried adding window.print(), but it says "window" is not a member. I also tried adding some javascript to my aspx page, then calling the function I defined in the "OnClick" property, but VS still didnt like it.
Is there some simple way to just print the form from a button click?
2) I have, in my aspx page, the tag: <body style="background-image:url(renew_bkgrd2.jpg)">
Is there some way for me to change this in the code behind page before the page is loaded so I can slip a different jpg in there?
I did some searching on this forum, and the tutorials and code library sections too, but didnt find what I needed.
Searching google just turned up a lot of sites about how to make a printer friendly version of your page, but not how to actually print.
1) How do I add a button to my page to print my aspx page? I dont need to pretty up the page, or move any controls or anything, I just want to pop up the print dialog and let the user print the page.
Looks like the most common thing to do is "window.print()", but Visual Studio doesnt like that. I have an "ASP:Button" control and in its "OnClick" property I tried adding window.print(), but it says "window" is not a member. I also tried adding some javascript to my aspx page, then calling the function I defined in the "OnClick" property, but VS still didnt like it.
Is there some simple way to just print the form from a button click?
2) I have, in my aspx page, the tag: <body style="background-image:url(renew_bkgrd2.jpg)">
Is there some way for me to change this in the code behind page before the page is loaded so I can slip a different jpg in there?