Showing posts with label Confirmation Message Box. Show all posts
Showing posts with label Confirmation Message Box. Show all posts

Tuesday, February 24, 2015

Confirmation Message Box in ASP.NET using VB.NET



Public Sub CreateConfirmationAlert(ByRef page As System.Web.UI.Page, ByVal message As String, ByVal key As String)

        Dim script As String = "<script language=JavaScript>var bReturn; bReturn = confirm('" &    message & "');</script>"

If (Not page.ClientScript.IsStartupScriptRegistered(key)) Then
            page.ClientScript.RegisterStartupScript(HttpContext.Current.CurrentHandler.GetType(),       key, script)
       End If

    End Sub