Found a great little snip of code online today from csharphelp.com about how to open a new browser window from a C# codebehind:
Response.Write("<SCRIPT language=javascript>var w=window.open('Rpt_OrderStatus_Form.aspx','OrderStatus','height=800,width=800');</SCRIPT>");
…but, one of the comments on that thread is that the Response.Write disrupts the page appearance. Any thoughts/suggestions on a better way to open a new browser window from a C# codebehind?
Try this:
ClientScript.RegisterStartupScript( this.GetType(), “PopupWindow”, “var w=window.open(‘Rpt_OrderStatus_Form.aspx’,’OrderStatus’,’height=800,width=800′);” );
Oh, nice! Thanks! 🙂