repeater嵌套RadioButtonList赋值
<asp:Repeater ID="Repeater1" runat="server"
onitemdatabound="Repeater1_ItemDataBound">
<ItemTemplate>
<%# Convert.ToDateTime(Eval("createtime")).ToShortDateString() %><br />
<a href='<%#Eval("id") %>'></a><%--传参用--%>
<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Value="aa">aa </asp:ListItem>
<asp:ListItem Value="bb">bb </asp:ListItem>
<asp:ListItem Value="cc">cc </asp:ListItem>
</asp:RadioButtonList>
备注<asp:TextBox ID="txtDetail" Width="500px" Height="50px" runat="server"></asp:TextBox><br /><br />
</ItemTemplate>
</asp:Repeater>
cs代码页:
protected void BindRepeater1()
{
kaoqinTab = kaoqinAda.GetData(**);
Repeater1.DataSource = kaoqinTab;
Repeater1.DataBind();
}
//绑定原考勤信息
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
RadioButtonList rbl = e.Item.FindControl("RadioButtonList1") as RadioButtonList;
TextBox txtDetail = e.Item.FindControl("txtDetail") as TextBox;
DataRowView rowv = (DataRowView)e.Item.DataItem;
string id = rowv["id"].ToString();
kaoqinTab = kaoqinAda.GetDataById(Convert.ToInt32(id));
if ("1" == kaoqinTab[0]["aaaa"].ToString())
{
rbl.SelectedValue = "aa";
}
if ("1" == kaoqinTab[0]["bbbb"].ToString())
{
rbl.SelectedValue = "bb";
txtDetail.Text = kaoqinTab[0]["bbDetail"].ToString();
}
if ("1" == kaoqinTab[0]["cccc"].ToString())
{
rbl.SelectedValue = "cc";
txtDetail.Text = kaoqinTab[0]["ccDetail"].ToString();
}
}
}
repeater嵌套RadioButtonList赋值的更多相关文章
- python 字典嵌套字典赋值异常
针对dict中 嵌套dict 出现复制异常 lists={} test=['s1','s2','s3'] data = {'value': '',} for i in range(2): lists[ ...
- Repeater 嵌套,子级Repeater获取 父级Repeater 中的值
第一种方法,子级Repeater中绑定父级的某个字段: <%# DataBinder.Eval((Container.NamingContainer.NamingContainer as Rep ...
- Model对象嵌套list赋值方式(备忘)
首先定义Model对象:var deliveryInfoModel = new DeliveryInfo(); 第二步定义嵌套的list对象:var list = new List<Delive ...
- Repeater嵌套(灵活的)
页面代码 <form id="form1" runat="server"> <asp:Repeater ID="rptCategor ...
- 借助Spring工具类如何实现支持数据嵌套的赋值操作
假设有两个Bean A和B,想将B中的属性赋值到A实体中,可以使用get set来实现,当属性过多时,就会显得很冗余,可以使用spring提供的BeanUtils.copyProperties()来实 ...
- Repeater嵌套Repeater并取得嵌套Repeater里面的控件
前台代码: <asp:Repeater ID="RepeaterScene" runat="server" OnItemDataBound=&quo ...
- ASP.NET Repeater嵌套Repeater实现菜单加载
在KS系统中要实现从数据库中读取界面权限文件实现菜单.界面的动态加载. 效果图: ASP.NET界面代码 <div id="menu-container"> <a ...
- 关于Repeater嵌套绑定的问题
前台代码: <div id="firstpane" class="menu_list"> <asp:Repeat ...
- Repeater嵌套绑定Repeater
前台Html代码 <asp:Repeater runat="server" ID="rpList" OnItemDataBound="rpLis ...
随机推荐
- H-Index II @python
Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize ...
- Spring Batch批处理以及编程模型
1.批处理: 类似于SQL里面的批处理提交 2.场景: 业务定时进行批处理操作,但是批处理的编程模型是怎么的呢? 3.开源框架 Spring Batch 4.编程模型: reader-processo ...
- 为github帐号添加SSH keys(Linux和Windows)
文章转自:https://blog.cofface.com/archives/406.html/2 一.Linux增加ssh keys方法: 使用git clone命令从github上同步github ...
- idea-activate code
N757JE0KCT-eyJsaWNlbnNlSWQiOiJONzU3SkUwS0NUIiwibGljZW5zZWVOYW1lIjoid3UgYW5qdW4iLCJhc3NpZ25lZU5hbWUiO ...
- selenium+python自动化87-Chrome浏览器静默模式启动(headless)
前言 selenium+phantomjs可以打开无界面的浏览器,实现静默模式启动浏览器完成自动化测试,这个模式是极好的,不需要占用电脑的屏幕. 但是呢,phantomjs这个坑还是比较多的,并且遇到 ...
- ssh连接失败,提示 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
[root@iZ2ze4kh1rvftq4cevdfjwZ ~]# ssh IP @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ...
- JAVA Spring JavaBean 引入 JavaBean ( 外部引用, 内部定义, 级联属性 )
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...
- css上下或者上中下 自适应布局
方法就是头部不变,中间和底部绝对定位 *{ margin: ; padding: ; } div{ text-align: center; font-size: 30px; } .header,.fo ...
- 5 python 内置类
1.实例属性和类属性 给实例绑定属性的方法是通过实例变量,或者通过self变量: class Chinese: def __init__(self,name,sex,age): self.name = ...
- 通过yumdownloader下载rpm包
通过yum自带的一个工具:yumdownloader [root@web1 ~]# rpm -qa |grep yum-utils [root@web1 ~]# yum -y install yum ...