title: asp.net gridview onrowcommand -->( GridViewCommandEventArgs)
body: <p>I want to ask how to get a text or value of a button inside the gridview?
  but i want to get the text value from this onrowcommand which use <strong>GridViewCommandEventArgs</strong> as its parameter.</p>
  
  <p>as if im using onrowdatabound is (<strong>GridViewRowEventArgs</strong>), which makes it easy for me to get the button.text inside the gridview </p>
  
  <pre><code>string example = ((Button)e.Row.FindControl("btnStop")).Text;
  </code></pre>
  
  <p>I want to get the button.text to do an if else loop inside the onrowcommand.
  Anyone know how?</p>
  
  <pre><code> &lt;asp:GridView ID="GridView1" runat="server" AllowPaging="True" CellPadding="2" CellSpacing="2"    HorizontalAlign="Center"   PageSize="5"  Width="133%" DataKeyNames="SurveyID" DataSourceID="SqlDataSource1" 
    AutoGenerateColumns="False" onrowcommand="stop_survey" 
         onrowdatabound="filter_select" onselectedindexchanging="selected" 
                                     &gt;
  </code></pre>
  
  <p>code behind</p>
  
  <pre><code> public void filter_select(object sender, GridViewRowEventArgs e)
   {
      if (e.Row.RowType == DataControlRowType.DataRow)
      {....
       ((Button)e.Row.FindControl("btnStop")).Text = "Start"; 
      }
   }
  
   public void stop_survey(object sender, GridViewCommandEventArgs e)
   {
        //i want to get the "btnStop" button text which is nested on the gridview.
   }
  </code></pre>
  
  <p>i want to get the btnStop text, as I want to have different sqlstatement depending on its text (eg. Start or Stop)
  the problem is i cant do e.Row inside stop_survey.
  Please guide me.</p>