Hi all,
Today a useful post sencillote but whenever I get to do something like throw me over 15 minutes looking in Google how to do it. If you look at the post title will be more or less clear: get a MessageBox or a Alert from an aspx page or ASP.NET
just before doing a redirect (an example is the typical case where you send an email and want to to leave a message and then redirect you to another page.)
The only code that never fails and therefore always works is the following:
and
sbScript = new StringBuilder StringBuilder ();
sbScript.Append (language='JavaScript' \u0026lt;script type='text/javascript'> "); sbScript.Append ("alert ('HelloWorld'); window.location = '. / default.html'");
bScript.Append ("\u0026lt;/ script>");
/ / The ScriptManager recorded the previous script.
Page.ClientScript.RegisterStartupScript (this.GetType (), "@@@MyCallBackAlertScript "sbScript.ToString (), false);
Test, test .... never fails! :-D Salu2
0 comments:
Post a Comment