title: Get data from RowCommand
body: <p>I have a grid which shows product versions and have a few link buttons like edit, delete, preview etc.
  On click of the edit button I want to get the Product ID and Version ID and redirect to some <em>xyz</em>.aspx page where the product details can be edited.<br>
  Here is how my Grid looks:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;asp:GridView ID="grdBindVersion" runat="server" AutoGenerateColumns="false" 
              onrowcommand="grdBindVersion_RowCommand" &gt;
  
  
  
          &lt;RowStyle BorderStyle="Solid" BorderWidth="1px" /&gt;
          &lt;Columns&gt;
              &lt;asp:BoundField datafield="HistoryId"  HeaderText="Version ID."&gt;
                          &lt;HeaderStyle CssClass="grid"&gt;&lt;/HeaderStyle&gt;
              &lt;/asp:BoundField&gt;
  
              &lt;asp:BoundField datafield="Title" HeaderText="Title"&gt;
                          &lt;HeaderStyle CssClass="grid"&gt;&lt;/HeaderStyle&gt;
              &lt;/asp:BoundField&gt;
  
               &lt;asp:TemplateField HeaderText = "Edit"&gt;
                     &lt;ItemTemplate&gt;
  
                         &lt;asp:LinkButton ID="Edit" runat="server" CommandArgument='&lt;%# Container.DataItem %&gt;'  CommandName ="Add"&gt;Edit&lt;/asp:LinkButton&gt;
                     &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
  
                &lt;asp:TemplateField HeaderText = "Delete"&gt;
                     &lt;ItemTemplate&gt;
                             &lt;asp:LinkButton ID="Delete" runat="server"&gt;Delete&lt;/asp:LinkButton&gt;
                     &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
  
                &lt;asp:TemplateField HeaderText = "Add Sub Page"&gt;
                     &lt;ItemTemplate&gt;
                              &lt;asp:LinkButton ID="AddSubPage" runat="server"&gt;Add Sub Page&lt;/asp:LinkButton&gt;
                     &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
  
                &lt;asp:TemplateField HeaderText = "Add Rank"&gt;
                     &lt;ItemTemplate&gt;
                              &lt;asp:LinkButton ID="AddRank" runat="server"&gt;Add Rank&lt;/asp:LinkButton&gt;
                     &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
  
                &lt;asp:TemplateField HeaderText = "Approve/DisApprove"&gt;
                     &lt;ItemTemplate&gt;
                             &lt;asp:LinkButton ID="ApproveStatus" runat="server"&gt;Approve/DisApprove&lt;/asp:LinkButton&gt;
                     &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
  
                &lt;asp:TemplateField HeaderText = "Complete"&gt;
                     &lt;ItemTemplate&gt;
                              &lt;asp:LinkButton ID="Complete" runat="server"&gt;Complete&lt;/asp:LinkButton&gt;
                     &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
  
                &lt;asp:TemplateField HeaderText = "Preview"&gt;
                     &lt;ItemTemplate&gt;
                              &lt;asp:LinkButton ID="Preview" runat="server"&gt;Preview&lt;/asp:LinkButton&gt;
                     &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
  
                &lt;asp:TemplateField HeaderText = "Comment"&gt;
                     &lt;ItemTemplate&gt;
                              &lt;asp:LinkButton ID="Comment" runat="server"&gt;Comment&lt;/asp:LinkButton&gt;
                     &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
  
          &lt;/Columns&gt;
          &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>I am tracking the clicking on the link button  in the <code>RowCommand</code> event of the GridView.
  Here i want to get the VersionID and ProductID and then redirect to another page.
  Please help me.
  I am really new to coding.
  I did a bit of Google but none of the solutions are helping me. </p>