Results 1 to 5 of 5

Thread: Message box in ASP

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Question Message box in ASP

    Is it possible to make a message box using ASP? I have tried to use the same syntax as in VB but it doesn't work.
    Code:
    MsgBox "This is a test", vbOKOnly + vbInformation, "Test"

  2. #2
    Lively Member
    Join Date
    Jun 2002
    Location
    Kuwait
    Posts
    85
    Yes you can display a message like this :
    <script language="vbscript">
    sub fn1()
    msgbox ("<%response.write("your message")%>")
    end sub
    </script>

    And you have to call this function when you want to display the message

    if you want to display okcancel buttons or so like in vb just assign it to a variable as in vb.

    dim msg
    msg=msgbox ("<%response.write("your message")%>", vbokcancel)
    Last edited by kirankumar; Aug 13th, 2002 at 03:32 AM.
    Your attitude determines your altitude!!!

  3. #3
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    You cannot use msgbox on client in ASP as ASP is server-side technology. If you use a msgbox it will display on the server and halt all executition until it is cleared.

    You can use a client side msgbox, as kirankumar has described.
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  4. #4
    Hyperactive Member Anglo Saxon's Avatar
    Join Date
    Mar 2002
    Location
    Durham, UK
    Posts
    259
    If you use a msgbox it will display on the server and halt all executition until it is cleared.
    This wouldnt happen, you would just get an error message :

    Microsoft VBScript runtime error '800a0046'

    Permission denied: 'msgbox'

    blah blah blah...



    --
    Anglo Saxon

  5. #5
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    You can change the permissions though so it does occur.
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width