Friday, December 12, 2008

Method to display an alert box in .NET using javascript

Public Sub MessageBox(ByVal page As System.Web.UI.Page, ByVal message As String)
Dim Script As String = ""
page.ClientScript.RegisterStartupScript(Me.GetType, "MessageBox", Script)
End Sub

This method is very useful when programming in .NET and you want to display an alert message in your page. You could call this method for example to display the success message alert after a successful transaction.

No comments: