Reputation: 1034
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(cstype, "TestScript", csScriptText, true);
}
Upvotes: 0
Views: 590
Reputation: 114377
.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'";
Upvotes: 3