0

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.

3
  • is this a classic asp ? Commented Jun 10, 2014 at 3:51
  • this is .NET Framework 3.5 Commented Jun 10, 2014 at 3:54
  • just check the answer below Commented Jun 10, 2014 at 3:55

1 Answer 1

2

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);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.