title: call function behind the image button in GridView
body: <p>i am having two buttons in the gridview but they dont return anything event after using the "CommandName" in which i write the function name but it does not do anything.</p>
  
  <p>the screen shot is as follow:
  <img src="https://i.stack.imgur.com/5MkRq.png" alt="enter image description here"></p>
  
  <p>the two buttons are edit and delete.</p>
  
  <p>here is the snippet:</p>
  
  <pre><code>&lt;asp:ButtonField ButtonType="Image" ImageUrl="~/wp-content/themes/realia/assets/img/edit pencil change modify alter blue edit icon2.png" CausesValidation="true" Text="Edit" CommandName="Edit_data"&gt;
                  &lt;ControlStyle Height="30px" Width="30px" /&gt;
                  &lt;/asp:ButtonField&gt;
  &lt;asp:ButtonField ButtonType="Image" ImageUrl="~/wp-content/themes/realia/assets/img/500px-Delete_Icon2.png" Text="Delete"&gt;
                  &lt;ControlStyle Height="30px" Width="30px" /&gt;
                  &lt;/asp:ButtonField&gt;
  </code></pre>
  
  <p>c#:</p>
  
  <pre><code>protected void Edit_data(object sender, EventArgs e)
      {
          Response.Write("hello");
      }
  </code></pre>