[英]MVC3 Dropdown List in grid column, get selected value
I have a column in a grid that contains dropdown list. 我在网格中有一个包含下拉列表的列。 The row also has a link which takes me to an action method.
该行还有一个链接,它将我带到一个动作方法。 I need the selected value of the dropdown list in that row and pass it to the method.
我需要该行中下拉列表的选定值并将其传递给方法。
I have used jquery in the past to get the selected value of a dropdown list...but not when there are multiple drop down lists. 我过去使用过jquery来获取下拉列表的选定值...但是当有多个下拉列表时却没有。 Can you give me some ideas on how I could resolve this?
你能告诉我一些如何解决这个问题的想法吗?
It sounds like you're trying to write 这听起来像你正在努力写作
$(this).closest('tr').find('select.SomeClass').val()
This code will get the <tr>
containing this
, then find a select
in the row. 这段代码将获得包含
this
的<tr>
,然后在行中找到一个select
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.