asp.net中子级Repeater获取父级Repeater绑定项的值 Eval
2016-04-10 16:15
555 查看
1.子级Repeater中绑定父级Repeater的某个字段: 方法1 代码如下 :<%# DataBinder.Eval((Container.NamingContainer.NamingContainer as RepeaterItem).DataItem, "PropertyName") %> 方法2 代码如下 :<%# DataBinder.Eval((Container.Parent.Parent as RepeaterItem).DataItem, "PropertyName") %> 二层嵌套 代码如下 :<%# DataBinder.Eval((Container.Parent.Parent as RepeaterItem).DataItem, "PropertyName") %> 三层嵌套: 代码如下 %# DataBinder.Eval((Container.Parent.Parent.Parent.Parent as RepeaterItem).DataItem, "PropertyName") %> 四层嵌套 代码如下 :<%# DataBinder.Eval((Container.Parent.Parent.Parent.Parent.Parent.Parent as RepeaterItem).DataItem, "PropertyName") %> 2.在子级Repeater中引用父级Repeater某个控件的值: 代码如下 <%# (Container.Parent.Parent.FindControl("txtUserID") as TextBox).Text%>
www.111cn.net 编辑:bluestart 来源:转载
相关文章推荐
- ASP.NET MVC4入门教程(四):添加一个模型
- ASP.NET MVC4入门教程(二):添加一个控制器
- ASP.NET MVC4入门教程(一):入门介绍
- metasploit 中nessus nessus_connect问题:You must do this before any commands
- metaspolit 基础
- asp.net MVC 和 webForm的区别
- Aspnetpager对GridView分页并顺利导出Excel
- ListBox控件实现上移、下移、循环上移、循环下移操作
- 如何在ASP.NET MVC中使用ajax
- Asp.net动态添加GridView列
- asp.net mvc中自行搭建实现工厂模式的spring.net+三层架构 (15-4-20)
- ASP.NET MVC过滤器
- ASP.NET MVC4入门教程(一):入门介绍
- ASP.NET MVC4入门教程(二):添加一个控制器
- ASP.NET MVC4入门教程(三):添加一个视图
- ASP.NET MVC4入门教程(四):添加一个模型
- ASP.NET MVC4入门教程(五):从控制器访问数据模型
- ASP.NET MVC4入门教程(六):验证编辑方法和编辑视图
- ASP.NET MVC4入门教程(七):给电影表和模型添加新字段
- 扩展AspNetPager控件,增加动态设置PageSize的方法