How do I open a URL in a new Browser Window in ASP.NET?
This quick tip shows you how to open a URL in a new Browser Window in ASP.NET.
The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: How do I open a URL in a new Browser Window in ASP.NET?

Will CrocombePosted Nov 7, 2008, 6:00 AM EST
I have spent several hours searching for this line of code - thanks a million. Some people seemed to think it was impossible!
Matt KennedyeditedPosted Dec 11, 2007, 5:42 AM ESTEdited Dec 11, 2007, 5:44 AM EST
I can't get this to work on IE7 or FF. It only appears to register the script, but does not pop-up a new window. Am I doing something wrong?
Steven SchoonoverPosted Dec 15, 2006, 10:21 AM EST
mahesh, I have a little application that creates a couple of email links and once you click on the email link, it sends you to an asp.net login screen and from there you can view a list of excel reports by clicking a button for the report from a data grid. I have done a test with internet explorer 6 and if I click the first link it opens up a browser window and then if I go back to the email and click the second link, it creates a second login screen on the same browser page instead of opening up a new browser window. I tried to force the opening of a new page once I opened up a Excel file but it did not work . I think that is because I changed the header contents. Do you have any Idea how to get around this issue. here is the code where I send the file and try to redirect to a new page. Thanks Response.Clear() Response.AddHeader("Content-Disposition", "attachment; filename=" & MyFileInfo.Name) Response.AddHeader("Content-Length", MyFileInfo.Length.ToString) 'Response.ClearHeaders() 'Response.ClearContent() Response.ContentType = "Application/octet-stream" Response.TransmitFile(FileName) ', StartPos, FileSize) Response.Redirect("ViewReportDone")
Daniel YafacPosted Oct 9, 2006, 3:55 PM EDT
hi mahesh thank you, it's very useful but my page, after execute script, it loses its style (css): Response.Write("<script type='text/javascript'>window.open('/WebSite/Aviso.aspx?Mensaje=" & Mensaje & "','frmMensajeBox','height=200px,width=340px,top=200,left=250');</script>") help me, please Thank you Daniel Yafac