asp.net – 存储CheckBoxList的DataValueField值在哪里?
发布时间:2020-05-23 21:54:03 所属栏目:asp.Net 来源:互联网
导读:我在页面上有这个CheckBoxList: asp:checkboxlist runat=server id=Locations datasourceid=LocationsDatasource datatextfield=CountryName datavaluefield=CountryCode / 我想使用Javascript遍历客户端上的复选框元素并获取每个选
|
我在页面上有这个CheckBoxList: <asp:checkboxlist runat="server" id="Locations" datasourceid="LocationsDatasource" datatextfield="CountryName" datavaluefield="CountryCode" /> 我想使用Javascript遍历客户端上的复选框元素并获取每个选中复选框的值,但这些值似乎在客户端不可用. HTML输出如下所示: <table id="ctl00_Content_Locations" class="SearchFilterCheckboxlist" cellspacing="0" cellpadding="0" border="0" style="width:235px;border-collapse:collapse;">
<tr>
<td><input id="ctl00_Content_Locations_0" type="checkbox" name="ctl00$Content$Locations$0" /><label for="ctl00_Content_Locations_0">Democratic Republic of the Congo</label></td>
</tr><tr>
<td><input id="ctl00_Content_Locations_1" type="checkbox" name="ctl00$Content$Locations$1" /><label for="ctl00_Content_Locations_1">Central African Republic</label></td>
</tr><tr>
<td><input id="ctl00_Content_Locations_2" type="checkbox" name="ctl00$Content$Locations$2" /><label for="ctl00_Content_Locations_2">Congo</label></td>
</tr><tr>
<td><input id="ctl00_Content_Locations_3" type="checkbox" name="ctl00$Content$Locations$3" /><label for="ctl00_Content_Locations_3">Cameroon</label></td>
</tr><tr>
<td><input id="ctl00_Content_Locations_4" type="checkbox" name="ctl00$Content$Locations$4" /><label for="ctl00_Content_Locations_4">Gabon</label></td>
</tr><tr>
<td><input id="ctl00_Content_Locations_5" type="checkbox" name="ctl00$Content$Locations$5" /><label for="ctl00_Content_Locations_5">Equatorial Guinea</label></td>
</tr>
无法找到值(“cd”,“cg”,“ga”等).他们在哪?甚至可以在客户端访问它们,还是我需要使用转发器或其他东西自己构建这个复选框? 解决方法存储在ViewState中,如果没有 some hacking,则无法在客户端上访问它们.(编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net – 连接到MySQL导致错误“未找到数据源名称且未指定
- 在ASP.NET中创建一个适用于黑莓,Windows Mobile和iPhone的小
- asp.net-mvc – 将会话永久保持为stackoverflow
- asp.net-mvc – 在asp.net mvc中选择列表用法
- asp.net-mvc-3 – 在ASP.NET MVC 3中应用数据注释时,如何使
- asp.net-mvc – 在MVC Razor中,如何在子布局下面定义一个Re
- asp.net-mvc – 用相同的动词重载asp.net MVC控制器方法?
- 使用asp.net连接到mySQL数据库
- asp.net – 允许搜索机器人在没有会话ID的情况下抓取您的网
- asp.net – Restful MVC Web Api继承
推荐文章
站长推荐
- asp.net – 仅在本地主机上使用Fiddler
- asp.net – Jquery datepicker弹出窗口在IE8的选
- asp.net-mvc-3 – MVC3非顺序索引和DefaultModel
- asp.net – System.Web.Security.FormsAuthentic
- 使用Asp.net Web API时,使用DataContract和DataM
- asp.net – 正则表达式匹配10-14位数
- asp.net-mvc – MVC Model Binding不适用于Kendo
- asp.net – “localhost”上运行网站是非常慢
- 在Azure网络应用程序中显示ASP.NET 5错误页面
- asp.net-mvc-3 – Request.Url何时可以为null?
热点阅读
