How to call Confirmation box in IF condition from Code-Behind?
<p>I'm using a LinkButton and a DropDown.</p>

<p>When I click on the LinkButton the DropDown appears.</p>

<p>After selecting a DropDown value, I want a confirmation box called from JavaScript to appear, ensuring that the value is changed.</p>

<p>I'm calling this script in the second <code>if</code> condition, but it's not working.</p>

<p>After the confirmation I want to change the other value and exit from the condition.</p>

<pre><code>protected void lnkbtnSave_Click(object sender, EventArgs e)
{
    if ((ddlHiringManager.SelectedItem != null &amp;&amp;
        (ddlHiringManager.SelectedItem.Text != lblHiringManager.Text)) &amp;&amp;
        (Convert.ToInt32(ddlHiringManager.SelectedValue)) != -1)
    {

        if (ClientScript.RegisterStartupScript(typeof(Page), "Confirm", "&lt;script type='text/javascript'&gt;Confirm('Are you sure you want to change Hiring Manager for this requirement.');&lt;/script&gt;"))
        {
            ClsClientManager objClientManager = new ClsClientManager();

            if (objClientManager.UpdateHRManagerByReqID(Convert.ToInt32(hdnReqId.Value), Convert.ToInt32(ddlHiringManager.SelectedValue)) &gt; 0)
            {
                lblShowHiringManager.Text = ddlHiringManager.SelectedItem.Text;
            } 
        }      
    }
    else
    {
        ClientScript.RegisterStartupScript(typeof(Page), "SymbolError", "&lt;script type='text/javascript'&gt;alert('Please Select Hiring Manager !');&lt;/script&gt;");            
    }
}
</code></pre>
