title: How to show catch error message in ScriptManager.RegisterClientScriptBlock
body: <p>How to show catch error message in ScriptManager.RegisterClientScriptBlock?
  below is my button click event.like we can get error message in label by using ex.message so how to use this in alert popup message box?</p>
  
  <pre><code> public void IssueDelete()
    {
     try
      {
        //open the db connection if it is closed...  
         if (connection.State == ConnectionState.Closed)
             connection.Open();
          int issueId = Convert.ToInt32(ddlComplaintDelete.SelectedValue);
          command = new SqlCommand();
          command.CommandText = "sp_IssueDelete";
          command.CommandType = CommandType.StoredProcedure;
          command.Parameters.AddWithValue("@registrationId", lblUploadRegistrationId.Text);
          command.Parameters.AddWithValue("@issueId", issueId);
          command.Connection = connection;
          command.ExecuteNonQuery();
          ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert('Issue Deleted Succesfully');", true);
       }
       catch (Exception ex)
       {
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert('Cannot Delete');", true);
       }  
       finally //Close db Connection if it is open....  
       {
        if (connection.State == ConnectionState.Open)
        connection.Close();
       }
    }
  protected void btnComplaintDelete_Click(object sender, EventArgs e)
          {
           IssueDelete();            
          }
  </code></pre>