How to print a web form (webpage) in Asp.net


Description:-
In this tutorial I am going to explain how to print a web form (webpage) in asp.net using C#.

Method 1:

<asp:Button ID="btnprint" runat="server" Text="Print" OnClientClick="javascript:window.print()"/>

Method 2:

On button click right the below given code:

protected void btnprint_Click(object sender, EventArgs e)
{
    Page.ClientScript.RegisterStartupScript(this.GetType(), "Printpage", "javascript:window.print();", true);
}

Related Posts

Thanks for comments.....

:)
:(
hihi
:-)
:D
=D
:-d
;(
;-(
@-)
:P
:o
:>)
(o)
:p
:-?
(p)
:-s
(m)
8-)
:-t
:-b
b-(
:-#
=p~
$-)
(y)
(f)
x-)
(k)
(h)
cheer