lulutanseco
lulutanseco

Reputation: 321

Javascript Message Box in ASP.NET webapp

I am using the code below to handle some exceptions in the webapp I'm building:

            Dim msg As String
            Dim SF_msg As String = "Please input lower bounds in SF Parameter Section"
            msg = "<script language = 'javascript'>"
            msg += "alert('" & SF_msg & "');"
            msg += "<" & "/script>"
            HttpContext.Current.Response.Write(msg)

The output of the code is a messagebox that apparently temporarily hides the page in order to show the message.

enter image description here

What I would like however is a javascript message box that stays on the page without hiding it. Something like the "confirm navigation" message in most webapps:

enter image description here

Please advise. Thanks in advance.

Upvotes: 0

Views: 227

Answers (1)

Ali
Ali

Reputation: 2592

use this one instead: (needs to be converted to VB)

 ScriptManager.RegisterStartupScript(this, this.GetType(), "confirm", 
        "confirm('Please input lower bounds in SF Parameter Section');", true);

Upvotes: 2

Related Questions