I am currently learning ASP.NET and I've been wonderin开发者_如何转开发g 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?
You can make a document.getElementByID in a javascript and call the .click() of this button.
You can use GridView.Row.FindControls('controlId')
You can check it on MSDN here.
精彩评论