How to redirect to a different page from a javascript alert box in a .net application?
I have a web application where i am displaying an javascript alert box when user edits fields and clicks on the save button.Then i want to redirect the page to home page when user clicks "ok" on the javascript alert box ? I am using c# code
Type cstype = this.GetType();
ClientScriptManager cs = this.ClientScript;
if (!cs.IsStartupScriptRegistered(cstype, "AlertScript"))
{
String csScriptText = "alert(' settings have been saved ');";
cs.RegisterStartupScript(cstyp开发者_开发技巧e, "TestScript", csScriptText, true);
}
.NET really has nothing to do with it since it all happens on the client via JavaScript.
String csScriptText = "alert(' settings have been saved ');document.location='http://.../newurl.htm'";
精彩评论