1.11M Members

Buttons in gridview not working

 
0
 

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?

 
0
 

Yes but this was a different problem I was having with the page. Was able to sort it, just needed a clean refresh of the page.

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article