Open a new window within the aspx.cs page with ASP.NET (C#)
Posted on 2003-11-19
I hope you can help --
I've been having a difficult time with this one. I need to be able to open a new window (to show a 'printer-friendly' version of the page) and I keep running into problems.
And the code on the aspx.cs page:
private void btnPrint_Click(object sender, System.Web.UI.ImageClickEventArgs e)
string openPrintPage = "";
openPrintPage += "window.open('Assess-ReportView.aspx?OrgReviewID=" + AssessmentID + "&Section=PrintView');";
openPrintPage += "</script>";
When ran, it doesn't open to a new page. It appears to do an autopostback and "erase" the data on-screen without ever opening a new window.
Thanks in advance!