Retrieive ids from the checked checbox itens in a GridView Row
I need present a grid-view in the web page, and based on the checkbox that each grid row has I want to retrieve and submit a value of the ID of each grid column. I'm using asp.net mvc and the mvc contrib grid, but accept suggestions on 开发者_Go百科how to do via JQuery or Javascript too. Thanks.
You'd need to bind them to a list, take a look at this article from Phil Haack which will tell you how and give you a few ideas for other scenarios: http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx
Done, I've put the checks with the same ID of the "id" field and retrieveid the cheched with a foreach Jquery function...Worked very well.
精彩评论