title: Javascript Confirmation On if..else.. condition
body: <p>I have to show confirmation dialogue on particular condition.And then proceed according to YES or No clicked.I tried with the following.</p>
  
  <p>In aspx:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    function ShowConfirmation() {
      if (confirm("Employee Introduced already.Continue?") == true) {
        document.getElementById("hdn_empname").value = 1;
      }
    }
  
  &lt;/script&gt;
  
  &lt;asp:HiddenField ID="hdn_empname" runat="server" /&gt;
  </code></pre>
  
  <p>in cs:</p>
  
  <pre><code>  if (reader2.HasRows)
      {  
          Page.ClientScript.RegisterStartupScript(this.GetType(), "showAl", "ShowConfirmation();", true);
      }
      else
      {
          hdn_empname.Value ="1";
      }
  
      if ((hdn_empname.Value)=="1")
      {
         //some code to execute
      }
  </code></pre>
  
  <p>But <code>hdn_empname</code> shows <code>value=""</code> while debuging.</p>
  
  <p>Can anyone help me doing this?</p>
  
  <p>Thanks in advance.</p>