1,105,633 Community Members

Buttons in gridview not working

Member Avatar
coder91
Junior Poster in Training
97 posts since Oct 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
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?

LastMitch
Deleted Member
 
0
 

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?

Didn't someone already explain how to unlocked it:

http://www.daniweb.com/web-development/aspnet/threads/448833/gridview-to-unlock-users

Does the query work for here:

http://www.daniweb.com/web-development/databases/threads/448922/sql-code-to-get-information-from-three-tables

Member Avatar
coder91
Junior Poster in Training
97 posts since Oct 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
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 three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article