title: GridView control with two asp:Command columns using the same command
body: <p>I have an ASP.NET <code>GridView</code> control with two <code>asp:CommandField</code> columns that are both using the Select command to perform different tasks.  How do I distinguish which column was selected in the <code>OnRowCommand</code> event when both return "Select" when I check the <code>CommandName</code> property of the <code>GridViewCommandEventArgs</code> object?</p>
  
  <p>Here is my source code:</p>
  
  <p>ASPX page:</p>
  
  <pre><code>&lt;asp:GridView ID="MyGridView" runat="server" AutoGenerateColumns="false" OnRowCommand="MyGridView_OnRowCommand"&gt;
      &lt;Columns&gt;
          &lt;asp:CommandField ButtonType="Link" ShowSelectButton="true" SelectText="Click Me!" /&gt;
          &lt;asp:CommandField ButtonType="Link" ShowSelectButton="true" SelectText="No Click Me!" /&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>Code behind:</p>
  
  <pre><code>protected void MyGridView_OnRowCommand(object sender, GridViewCommandEventArgs e)
  {
      string x = e.CommandName //returns "Select" for both asp:CommandField columns
  }   
  </code></pre>