how to show confirmation dialog from drop down list?
<p>i have a grid which display data from database, and i have a custom column in the left side with checkbox, i choose records to be deleted and i have a dropdown list, which will trigger an event in server side to delete records, before i delete those records i want to show a confirmation dialog like "are you sure? with ok and cancel", how to do that? any thought?</p>

<p>i do this :</p>

<pre><code> if(ddlAction.SelectedValue == "Delete")
 {
     string id = string.Empty;
     int i = 0;
     List&lt;int&gt; idx = new List&lt;int&gt;();

     foreach (GridViewRow rowitem in gvDept.Rows)
     {
        CheckBox itemchk = (CheckBox)rowitem.FindControl("cbSelectOne");

        if (itemchk != null &amp; itemchk.Checked)
        {
             id += rowitem.Cells[3].Text.ToString() + ',';
              idx.Add(i);
         }

          i = i + 1;
      }

      id = id.Trim(",".ToCharArray());
      List&lt;string&gt; objRemoveKeys = id.Split(',').ToList();

      if (objRemoveKeys.Count &gt; 0)
      {     
         ddlAction.Attributes.Add("OnChange", "javascript:return confirmDeletion('Are you sure you would like to remove the selected items?');"); // this part not working.

         AirAsiaLinqDataContext LinqDataCtx = new AirAsiaLinqDataContext();

         var record = from a in LinqDataCtx.departements
                      where objRemoveKeys.Contains(a.departementcode)
                      select a;

         LinqDataCtx.departements.DeleteAllOnSubmit(record);
         LinqDataCtx.SubmitChanges();


         for (int j = 0; j &lt; idx.Count; j++)
         {
             gvDept.DeleteRow(idx[j]);
         }
    }

   ddlAction.SelectedValue = "";
</code></pre>

<p>}</p>
