How to get my msg box to work

Discussion in 'C#' started by snufse, Jun 29, 2009.

  1. #1
    I have an asp application where I show a "confirm" msg box. I am not able to code my mark up or code behing to capture the result, Can someone help?

    calls the msg box sub

    ASPNET_MsgBox_Confirm(Response(0))
    Code (markup):
    the msg box sub

    Public Overloads Sub ASPNET_MsgBox_Confirm(ByVal Message As String) 'Confirm
    
            hiddenMsgDiv.InnerHtml = "<script type=""text/javascript"">confirm('" & Message.Replace("\", "\\").Replace("'", "\'") & "');</script>"
    
    End Sub
    Code (markup):
    This is what I have for my "alert" but not sure how to go about the confirm

    <div id="hiddenMsgDiv" runat="server" style="display: none">
        </div>
    Code (markup):
     
    snufse, Jun 29, 2009 IP
  2. dopanel.com

    dopanel.com Peon

    Messages:
    93
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you setting any div to display:none,then all the script in this div won't work at all.
     
    dopanel.com, Jun 30, 2009 IP
  3. ziv

    ziv Peon

    Messages:
    18
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    In you javascript code, just assign the result of confirm() to a local variable:

    var result = confirm(...)
     
    ziv, Jul 23, 2009 IP