Re: Retrieving Msgbox Values From Client

Discussion in 'ASP .Net' started by Alex Papadimoulis, May 12, 2004.

  1. Hi Jon,

    You'll need to store the value of the message box in a hidden field element,
    and then submit the form.

    In javascript, it would look like:
    document.forms[0].myHiddenField.value = confirm('Are you sure?');
    document.forms[0].submit();

    -- Alex Papadimoulis

    "Jon" <admin(take this out)@jonhickman.com> wrote in message
    news:...
    > Hi,
    > I have the following code behind the click event of a button on an ASP.Net

    page...
    >
    > Dim sMessage As String
    >
    > sMessage = "<script language=VBScript>" &

    System.Environment.NewLine
    > sMessage += " " & "Dim iMsgBoxValue" &

    System.Environment.NewLine
    > sMessage += "iMsgBoxValue = Msgbox('Send This Message?',

    vbYesNoCancel + vbQuestion)" & System.Environment.NewLine
    > sMessage += System.Environment.NewLine
    > sMessage += "</script>"
    > sMessage = Replace(sMessage, "'", """")
    > RegisterClientScriptBlock("script1", sMessage)
    >
    > Very simple, displays a msgbox.
    >
    > QUESTION: How do I pull the value of iMsgBoxValue out of the client

    script?? In other words, how can I determine what button (Yes, No, Cancel)
    the client clicked?? It has got to be simple, but I cant find the answer.
    >
    > Thanks for any help,
    >
    > Jon
    Alex Papadimoulis, May 12, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Newby
    Replies:
    1
    Views:
    1,688
  2. Steve C. Orr [MVP, MCSD]

    Re: Retrieving Msgbox Values From Client

    Steve C. Orr [MVP, MCSD], May 12, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    385
    Steve C. Orr [MVP, MCSD]
    May 12, 2004
  3. Peter Rilling

    Re: Retrieving Msgbox Values From Client

    Peter Rilling, May 12, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    388
    Peter Rilling
    May 12, 2004
  4. user
    Replies:
    0
    Views:
    374
  5. user
    Replies:
    0
    Views:
    151
Loading...

Share This Page