如何检查gridview的复选框是否被选中?

时间:2014-04-05 09:15:08

标签: javascript c#-4.0 gridview

enter code here我有一个Gridview,每行包含5个复选框,其中包含名称' NO',' YES',' NA',' ; NA / U'和' REPEAT'。我想要启用一个按钮,如果任何一个复选框没有' NO' ' YES' ' NA'或者' NA / U'选中所有行的复选框。我如何才能实现此功能。 Javascript会更好还是C#?帮帮我这个

                                                                                                                                                                                                                                                              ' RUNAT ="服务器">                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <% -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

1 个答案:

答案 0 :(得分:0)

当然javasript / jquery会更好。您可以在gridview行中找到已选中的复选框,并将该计数与gridview的行匹配。

使用以下语法查找gridview行中选中的复选框。

$("[id$='GridID'] tr td input[type=checkbox]:checked");