I have a template field in my gridview which holds a button for each row, however when I test it to see if it's working it doesn't do anything, the page just reloads but nothing has happened. What I want the button to do in the end is to unlock a user. At the minute I'm testing it by having a panel appear if the button is clicked.
<asp:TemplateField> <ItemTemplate> <asp:Button ID="btnUnlock" runat="server" CommandArgument='<%# Eval("UserId") %>' CommandName="Select" Text="Unlock" OnCommand="btnUnlock_Command"/> </ItemTemplate> </asp:TemplateField>
This is the part of the gridview for the button, not sure for the code behind should I use the button onCommand method or gridview rowCommand method?