Tuesday, September 15, 2009

Alert box and Response.Redirect issue

Response.Redirect means "Don't render this page. Go to this page instead.", so the behavior is expected.

Also, you should never use Response.Write, unless you're creating some kind of custom generated file download.

You can do it in a few ways..

Page.ClientScript.RegisterClientScriptBlock(Page.GetType(),"success","alert(' sucessfully added');window.location.href='AddRoute.aspx';",true)

http://forums.asp.net/t/1445275.aspx
http://www.dotnetspider.com/forum/ViewForum.aspx?ForumId=97545

No comments: