Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am trying to call print setup on link button click in asp.net plz any one help me i am new in asp.net
Posted

1 solution

I believe you simply call the print method in window from javascript, then the user chooses how they want to print the page.

HTML
<a href="javascript:void(0);" onclick="window.print();">Print Me</a>

C#
<asp:linkbutton text="Print Me" onclientclick="window.print();" xmlns:asp="#unknown" />
 
Share this answer
 
Comments
Alok.singh1166 31-Jul-13 8:35am    
Thanks for the answer i have one more query that i have a pdf in my asp.net page and that i want to print on linkbutton click..(http://localhost/orange//documents/applicants/<%=CustomerIde %>/AccountStatement.pdf )i have that pdf on this location this i have to print can you plz help me
onelopez 31-Jul-13 12:42pm    
you can't tell the browser to print content that is not there. you would have to first display the pdf in the browser, then call the print method from javascript or you can have the user download the pdf and then print it from their favorite pdf reader.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900