How to print a page.aspx in C#?
Hello
I'm new at asp.net and C#.
I have a page called Information.aspx. On that page there is a button "Print".
If you click that button I want to send the information that is on the page to print it out.
Can anybody help me?
studentcsharpPosted Oct 29, 2004, 11:02 AM
fadil1977Posted Oct 29, 2004, 4:23 AM
private void Page_Load(object sender, System.EventArgs e) { this.Button2.Attributes.Add("onclick", "window.print();"); }If you type in this in the pageload event, it will works fine as it works for me. I am sorry if i can not help about the other issuestudentcsharpPosted Oct 28, 2004, 10:12 PM
studentcsharpPosted Oct 28, 2004, 11:13 AM
fadil1977Posted Oct 26, 2004, 9:12 AM
this.Button1.Attributes.Add("onclick", "window.print();")where Button1 is the ID of the button so you should match it toyours Warning:- DO NOT type the code above in the click button event hope that helps