How can i take the print out of my asp.net page ?
I am not getting the code for it, if you have a code please help me.
Thanks.
How can i take the print out of my asp.net page ?
I am not getting the code for it, if you have a code please help me.
Thanks.
You can do it directly by using below javascript function,
function formprint()
{
window.print();
}
Use the Following Code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="PL_Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
@media print
{
.Hide
{
display:none;
}
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<asp:Button ID="btnBack" runat="server" Text="Back" style="left: 354px; position: relative; top: 166px" CssClass="Hide" />
<asp:Button ID="btnPrint" runat="server" Text="Print" OnClientClick="window.print();" style="left: 242px; position: relative; top: 165px"/>
</form>
</body>
</html>
Bookmarks