I am trying to print a specific part of my application. My div. It works in html single page, but not in my application. My page is in ASP.NET and c#, but as I could not embed the function in C#, i am trying through javascript. However, there is a problem with the property inner.html
error:
0x800a138f - JavaScript runtime error: Unable to get property 'innerHTML' of undefined or null reference
code:
<script type="text/javascript">
function printdiv
var prtContent = document.getElementById("specific");
var WinPrint = window.open('', '', 'left=0,top=0,width=800,height=900,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
</script>
<asp:Button ID="printButton" runat="server" Text="Print Results" OnClientClick="printdiv()"/>
My page is in asp, maybe that's the problem? How can i make it equivalent to print the div i want specifically?
edit, i don't know if it is relevant: specific part of div