Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I am currently learning ASP.NET and I've been wondering if is possible to find a button that is in a Gridview and perform a 'Click' on it when the user clicks on another button not in the Gridview.
Thanks, Y_Y
Are you looking to do this client side or server side?
Client side, you could find the GridView button via jQuery:
$('#<% buttonId.ClientID %>').click();
Server side, could you set the GridView's OnClick event to whatever you'd rather have it point to?
Add a comment
You can make a document.getElementByID in a javascript and call the .click() of this button.
You can use GridView.Row.FindControls('controlId')
GridView.Row.FindControls('controlId')
You can check it on MSDN here.
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.