Click here to Skip to main content
15,884,838 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
In my project I have a page with print option...It works on my local machine .But I Published it in Live It Throwing Error ....Please Help me

C#
<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>
<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

My Code for Print is
JavaScript
 <script type = "text/javascript">
     function PrintPanel() {
         var panel = document.getElementById("<%=pnlContents.ClientID %>");
         var printWindow = window.open('', '', 'height=400,width=800');
         printWindow.document.write('<html><head><title>DIV Contents</title>');
         printWindow.document.write('</head><body >');
         printWindow.document.write(panel.innerHTML);
         printWindow.document.write('</body></html>');
         printWindow.document.close();
         setTimeout(function () {
             printWindow.print();
         }, 500);
         return false;
     }
</script>

Asp>net code is
ASP.NET
 <asp:Panel id="pnlContents" runat = "server">
------------------
-----------------Data for Printing
----------------
</asp:Panel>


<asp:Button ID="btnPrint" runat="server" Text="Print" OnClientClick = "return PrintPanel();" />
Posted
Updated 31-Jul-14 3:41am
v3
Comments
Richard Deeming 31-Jul-14 9:31am    
How do you expect anyone to be able to help you when you haven't provided any details of the code or the error that's thrown?

Use the "Improve question" button to edit your question and provide the missing details.
phmani469 31-Jul-14 9:42am    
Sorry for poor English.....now is it clear or need more information
Richard Deeming 31-Jul-14 9:44am    
What's the error?
phmani469 31-Jul-14 9:47am    
i published my Project in Live, in that i have a page with print option. while loading that page show error ....i submitted my Javascript code in above.....i dont know what to do to clear the error....Please help me
Richard Deeming 31-Jul-14 9:49am    
Yes, but what is the error that it's throwing?

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