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

Previous
Next Post »

Thanks for comments.....