title: how to add delete confirmation prompt for command field in detail view?
body: <p>I want to prompt the user for confirmation when he tries to delete a record in a detail view? I have command filed in which showDeletebutton set to true. </p>
  
  <p>I found how to do the confirmation for gridview, but how can I modify to match detail view?</p>
  
  <p>Code:</p>
  
  <pre><code>protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
  {
  if (e.Row.RowType == DataControlRowType.DataRow)
  {
      // loop all data rows
      foreach (DataControlFieldCell cell in e.Row.Cells)
      {
         // check all cells in one row
         foreach (Control control in cell.Controls)
         {
              // Must use LinkButton here instead of ImageButton
              // if you are having Links (not images) as the command button.
              ImageButton button = control as ImageButton;
              if (button != null &amp;&amp; button.CommandName == "Delete")
                  // Add delete confirmation
                  button.OnClientClick = "if (!confirm('Are you sure " + 
                         "you want to delete this record?')) return;";
          }
      }
  }
  }
  </code></pre>
  
  <p>Anybody?</p>