Public Sub RedirectBox(ByVal page As System.Web.UI.Page, ByVal message As String, ByVal URL As String)
Dim Script As String = "
"
page.ClientScript.RegisterStartupScript(Me.GetType, "RedirectBox", Script)
End Sub
This method is very useful when programming in .NET and you want to display an alert message in your page before the page would redirect to another page. You could call this method for example to display the success message alert after a successful transaction before going back to the home page. Usually if we just use window.location after displaying alert, the tendency is that the alert box is not displayed and the page will immediately be redirected to the new URL. Using ClientScript.RegisterStartupScript, the alert will first display and the page will only redirect after clicking the OK button of the alert box.
This marks the end of a chapter...
-
KagoJen is no longer in Kago
so now I'm just plain ol' GaijinJen
Yep, that's why from now on,
I will be blogging on GaijinJen instead
15 years ago
No comments:
Post a Comment