#1
  1. John from Belfast
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    Belfast, Northern Ireland
    Posts
    63
    Rep Power
    11

    Permission denied: 'MsgBox'


    I want to create an onClick event that displays the user with a prompt to let them know that they're leaving a secure site. The prompy will have a Yes/No option. The error says:

    "Permission denied: 'MsgBox'"

    Below is my code:

    Code:
    Dim warning
    warning = MsgBox("You will be leaving the secure site." & Chr(13) & Chr(10) & "Continue anyway?",4, "WARNING!!!")
    
    <a href="http://www.bma.org.uk/ap.nsf/Content/accesshealthrecords" target="_blank" onClick="<% Response.Write(warning) %>">http://www.bma.org.uk/ap.nsf/Content/accesshealthrecords</a>
    Any one know how to fix this?

    John
    ___________________
    Come visit my webpage - http://www.mclernon.com
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,453
    Rep Power
    4539
    Your code is trying to do a msgbox on the server, is that what you intended?
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  4. #3
  5. Inherits Programmer.Slacker
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Aug 2003
    Location
    Between my Id and your Ego
    Posts
    2,351
    Rep Power
    726
    John - you can't raise messageboxes from the server to the client (at least not in this way). You can express script to the client, but not call messagebox.
    Fisherman

    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein
  6. #4
  7. John from Belfast
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    Belfast, Northern Ireland
    Posts
    63
    Rep Power
    11
    Right, didn't know thats what I was doing. Is there a way to do it on the client side? Javascript possibly?

    John
    ___________________
    Come visit my webpage - http://www.mclernon.com
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Posts
    1,882
    Rep Power
    20
    Use a Confirm box
    http://www.shiningstar.net/articles/articles/javascript/confirmsubmit.asp?ID=AW

IMN logo majestic logo threadwatch logo seochat tools logo