In my project there is a print button . after clicking that button I want to open a popup but it's not loading
<table class="inputForm">
<tfoot>
<tr>
<td align="right">
<asp:Button ID="btnPrint" OnClick="btnPrint_Click" Text="Printuiuiuiui" CssClass="button" runat="server" Visible="true" />
</td>
</tr>
</tfoot>
</table>
In .cs file
Page.ClientScript.RegisterStartupScript(typeof(Page), "s1", "openViewer('" + (int)ABCDEF.enReportName.PortfolioPrint + "');");
openViewer is a function that shows popup
function openViewer(reportName) {
sPath = "/ADDCD/Popups/ifggfjfj.aspx?Viewer.aspx?ReportName=" + reportName;
if (navigator.userAgent.indexOf("Chrome") != -1) {
return window.open(sPath, self, "dialogHeight: 374px; dialogWidth: 430px; status: no; resizable: no; center: yes;");
}
else if (navigator.userAgent.indexOf("Firefox") != -1) {
return window.open(sPath, self, "dialogHeight: 374px; dialogWidth: 430px; status: no; resizable: no; center: yes;");
}
else if ((navigator.userAgent.indexOf("MSIE") != -1) || (!!document.documentMode == true)) {
return window.showModalDialog(sPath, self, "dialogHeight: 374px; dialogWidth: 430px; status: no; resizable: no; center: yes;");
}
}
I tried with
Page.ClientScript.RegisterStartupScriptBlock
but not working . Anybody have any idea why it's not working?
What I have tried:
I tried with this
Page.ClientScript.RegisterStartupScript(typeof(Page), "openViewer",
"openViewer(" + (int)ABCDEF.enReportName.PortfolioPrint + ");", true);