0

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

3 Answers 3

2

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?

Sign up to request clarification or add additional context in comments.

Comments

1

You can make a document.getElementByID in a javascript and call the .click() of this button.

Comments

1

You can use GridView.Row.FindControls('controlId')

You can check it on MSDN here.

Comments

Your Answer

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.

Ask question

Explore related questions

See similar questions with these tags.