RowCommand not firing when clicking buttons inside TemplateField
<p>Basically I have a GridView:</p>

<pre><code>        &lt;asp:GridView ID="gvServices" runat="server" CellPadding="4" 
                      ForeColor="#333333" GridLines="None" AllowSorting="True" 
                      AutoGenerateColumns="False" OnRowCommand="gvServices_RowCommand"&gt;
            &lt;AlternatingRowStyle BackColor="White" ForeColor="#284775" /&gt;
</code></pre>

<p>And inside I have 2 TemplateFields:</p>

<pre><code>                &lt;asp:TemplateField&gt;
                    &lt;ItemTemplate&gt;
                        &lt;asp:Button ID="btnStart" runat="server" Text="Start" CommandName="StartService" CommandArgument="&lt;%# ((GridViewRow) Container).RowIndex %&gt;"/&gt;
                    &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
                &lt;asp:TemplateField&gt;
                    &lt;ItemTemplate&gt;
                        &lt;asp:Button ID="btnStop" runat="server" Text="Stop" CommandName="StopService" CommandArgument="&lt;%# ((GridViewRow) Container).RowIndex %&gt;"/&gt;
                    &lt;/ItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
</code></pre>

<p>Finally I have the method thats supposed to fire when clicking on either of the Buttons on the gridView, problem is that when I click either of them the event does not get called at all</p>

<pre><code>    public void gvServices_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int index = Convert.ToInt32(e.CommandArgument);
        if (e.CommandName == "StartService")
        {
            StartServiceItem(gvServices.Rows[index].Cells[0].Text, locations[index]);
        }
        if (e.CommandName == "StopService")
        {
            StopServiceItem(gvServices.Rows[index].Cells[0].Text, locations[index]);
        }
        loadGridView();
    }
</code></pre>
