RadioButtonList的使用
前台绑定:
<asp:RadioButtonList ID="hlBatchYuJi" runat="server" RepeatColumns="1" CellPadding="1" CellSpacing="1">
</asp:RadioButtonList>
js判断选中
var vRbtid = document.getElementById("hlBatchYuJi");
var vRbtidList = vRbtid.getElementsByTagName("INPUT"); //得到所有radio
for (var i = 0; i < vRbtidList.length; i++) {
if (vRbtidList[i].checked) {
BatchText = vRbtid.cells[i].innerText; //获取绑定的text值
Batchvalue = vRbtidList[i].value; //获取绑定的value值
}
}
if (BatchText == "") {
alert("请选择育雏批次!");
return;
}
cs文件后台绑定
LstBatch = BatchDB.Data.Where(o => o.EnID == UserInfo.EnId && LstChuJIIDs.Contains(o.FarmID) && !LstYiSheBatchID.Contains(o.ID)).ToList();
hlBatchYuJi.DataSource = LstBatch;
hlBatchYuJi.DataTextField = "BatchNo";
hlBatchYuJi.DataValueField = "ID";
hlBatchYuJi.DataBind();
赋值初值,选中的
var Info = YISheDB.Data.ToInfo(reqID);//根据ID获取数据
hlBatchYuJi.Items.Insert(0, new ListItem(Info.BatchNo, Info.BatchID.ToString())); //插入新的值
hlBatchYuJi.SelectedIndex = 0; foreach (ListItem item in hlFarmJi.Items) //循环判断选中
{
if (item.Value.ConvertType(0) == Info.FarmID)
{
item.Selected = true;
break;
}
}
RadioButtonList的使用的更多相关文章
- 初学ReactJS,写了一个RadioButtonList组件
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>React Demo</title> ...
- Jquery 操作CheckBox ,RadioButtonList,DropDownList
Jquery版本2.1.4 CheckBox 1.获取值: $("#chb").prop("checked"); RadioButtonList 1.获取值: ...
- jquery给net里面的RadioButtonList添加选项改变事件
<script type="text/JavaScript" src="../../../JS/jQuery-1.4.1.min.js"></ ...
- RadioButtonList 属性设置
RadioButtonList 属性里有RepeatDirection 设为Horizontal
- js判断radiobuttonlist的选中值显示/隐藏其它模块
<script> $(function () { var SelectVal = $("input[name='rblGJS']:checked").val(); if ...
- DropDownList的使用,RadioButtonList的使用
DropDownList的使用之从后台动态获取值 前端aspx代码如下 <asp:DropDownList ID="DDLTypeID" runat="server ...
- RadioButtonList单选和RequiredFieldValidator验证是否选中
<asp:RadioButtonList ID="Radio2" RepeatDirection="Horizontal" runat="ser ...
- CHtml::radioButtonList
public function getSortList(){ $arr = array(); $arr[0]['id']=0; $arr[0]['name']="否"; $arr[ ...
- RadioButtonList js获取选择的项
<asp:RadioButtonList ID="RadioButtonList1" runat="server"> <asp:ListIte ...
随机推荐
- sh back mongo
!/bin/shBACK_DB=ALLOUT_DIR=/home/jianyeruan/app/mongo #临时备份目录TAR_DIR=/home/jianyeruan/app/mongotar # ...
- Spark机器学习读书笔记-CH04
[root@demo1 ch04]# spark-shell --master yarn --jars /root/studio/jblas-1.2.3.jar scala> val rawDa ...
- 配置Java开发IDE
http://www.cnblogs.com/feichexia/archive/2012/11/07/Vim_JavaIDE.html
- php 字符串转数组
$str = "你好吗"; function str($str) { $length = mb_strlen($str); for ($i=0; $i<$le ...
- Eclipse_luna_J2EE_For_JS+tomcat8.0环境搭建、配置、开发入门
一.所有需要的软件.插件等下载地址 J2SE的官方下载路径:http://www.oracle.com/technetwork/java/javase/downloads/index.html Ecl ...
- 编译内核实现iptables防火墙layer7应用层过滤 (三)
在前面的两篇文章中我们主要讲解了Linux防火墙iptables的原理及配置规则,想博友们也都知道iptables防火墙是工作在网络层,针对TCP/IP数据包实施过滤和限制,属于典型的包过滤防火墙.以 ...
- Unreal Engine Plugin management
Be aware to remove any dependencies to any modules related to Editor, or else it will end up with fa ...
- z变换
---恢复内容开始--- z变换作用很大 将离散信号从时间域转到频率域 网址 ---恢复内容结束--- z变换作用很大 将离散信号从时间域转到频率域 网址 http://stackoverflow.c ...
- A Brief Review of Supervised Learning
There are a number of algorithms that are typically used for system identification, adaptive control ...
- python-phpbb3 (可以用python3 操作 phpbb3 论坛的模块)
python-phpbb3 2016年8月30日 04:50:48 codegay phpbb3是PHP写的开源的论坛,python-phpbb3这个项目是用python3实现很多对phpbb3论坛操 ...