Friday 13 July 2012

Open a Alert Box and open a new Window


//Open A Alert box.
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", @"alert('Invalid Login Email & Password.');", true);

//Open a Alert Box then press "Ok" which redirect the Page.
ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "alert('valid Login Email & Password.'); window.location.href = 'HomeAdmin.aspx';", true);

//Open a New Asp page in new Window

ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "window.open(\"Default3.aspx\")", true);

//Open a New website in new Window
        ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "window.open('http://www.google.com')", true);

//Constant width and height of the new Window and not resize.

string fullURL = "window.open('http://www.google.com', '_blank', 'height=500,width=800');";
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true);

No comments:

Post a Comment