Dear Experts,
I'm facing a problem with ASPX user control,
I have design a html in user control
I wish to print their html design (html div or table), have added JavaScript as below, but this JavaScript not working in user control
----------------------
then i have modify this code as below
In code behind
protected void btnPrint_Click(object sender, EventArgs e)
{
btnPrint.Attributes.Add("onclick", "PrintDiv();");
}
Still not working
Please help us.
Muhammad Aqib ShehzadPosted Jun 4, 2016, 6:24 AM
Manoj PatelPosted Jun 4, 2016, 5:39 AM
Mufid BagdadiPosted Jun 4, 2016, 5:29 AM
Manoj PatelPosted Jun 4, 2016, 5:18 AM
Mufid BagdadiPosted Jun 4, 2016, 5:06 AM
function PrintPanel() {
var panel = document.getElementById("<%=pnlContents.ClientID %>");
var printWindow = window.open('', '', 'height=400,width=800');
printWindow.document.write('
printWindow.document.write('');
printWindow.document.write(panel.innerHTML);
printWindow.document.write('');
printWindow.document.close();
setTimeout(function () {
printWindow.print();
}, 500);
return false;
}
Manoj PatelPosted Jun 4, 2016, 4:28 AM
Muhammad Aqib ShehzadPosted Jun 4, 2016, 2:55 AM