Alert Message Before Response.Redirect
-
Hi all, i have a issue. i need to display alert Message before the page is redirect to another page. 1)alert Message 2)Response.Redirect("test.aspx") Here, i have to use Response.Redirect complusory. Please Help Me. Thanks in Advance.
JohnDas
use inline javascript or clientscript block to achieve this functionality.. for example 1) scriptText = "window.alert(dsfas)"; ClientScriptManager.RegisterClientScriptBlock(this.GetType(), "CounterScript", scriptText, true); 2) Page.RegisterClientScriptBlock mehtod 3) http://support.microsoft.com/kb/817032[^] 4) http://www.eggheadcafe.com/community/aspnet/2/10045660/why-to-use-isclientscript.aspx[^]
Government Dyal Singh College Lahore.
-
Hi all, i have a issue. i need to display alert Message before the page is redirect to another page. 1)alert Message 2)Response.Redirect("test.aspx") Here, i have to use Response.Redirect complusory. Please Help Me. Thanks in Advance.
JohnDas
Alert is a client side operatoiin where as Response.Redirect is server side. You can't do both at same time because in your case you first need alert and then redirect. Soluton would be to out put some javascript that in turn do the desired task for you. For example try something like below in your ASP.NET code where you want this behaviour.
Share your experience with others Check my Blog...