title: Getting confirm value in code behind
body: <p>i have a pop up on the index change of a combo box and i need to get the result of the confirm box in the code behind:</p>
  
  <pre><code>Protected Sub service_list_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles service_list.SelectedIndexChanged  
  
  Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "confirm", x.javaMsg("Do you
  want to choose a date?"), True)
  
  If user clicks ok 
  GridView1.DataSource = x.selectCNT(service_list.SelectedValue)
  GridView1.DataBind()
  End Sub
  </code></pre>
  
  <p>this is my function:    </p>
  
  <pre><code>Public Function javaMsg(ByVal message As String) As String
  
      Dim sb As New System.Text.StringBuilder()
      sb.Append("window.onload=function(){")
      sb.Append("confirm('")
      sb.Append(message)
      sb.Append("')};")
      Return sb.ToString()
  
  End Function
  </code></pre>
  
  <p>note that i'm using asp.net with vb.net</p>