Recently i needed to show a Javascript alert on a button click and after user click "ok" on alert box i need to redirect to another page. Below code did work for me.
Add the code in your button click event.
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ss", "<script>alert('My Message! '); location.href = '" + ResolveUrl("~/Default.aspx") + "'</script>", false);
Thursday, January 3, 2013
Redirect page on JavaScript alert in ASP.NET
Subscribe to:
Post Comments (Atom)
No comments:
Write comments