-
-
Opening Window on Postback
by azamsharp on 5/12/2008 2:33:52 PM
-
Sometime we need to open a popup window on the postback event. Here is the code that I use to perform that task.
-
protected void Button1_Click(object sender, EventArgs e)
{
// Do some server side work
string script = "window.open('http://www.yahoo.com','Yahoo')";
if (!ClientScript.IsClientScriptBlockRegistered("NewWindow"))
{
ClientScript.RegisterClientScriptBlock(this.GetType(),"NewWindow",script, true);
}
}
-
Refactor it!
Please log in to refactor the code!
Login