ASP.NET 4.0 中 ClientIDMode的属性 可以设置获取不同ID格式的值。

项目中遇到的问题:

1、ListView1 ItemDataBound事件中,获取ClientID结果与自动生成ID一致。

2、ItemDataBound事件中不执行InsertItemTemplate段。(获取Insert中控件ID无法获取)

所以还得通过在ItemCreated时获取ClientID。结果后台中获取值与最终HTML自动生成ID字符串有差异。

解决方法:

在父容器控件ListView1的ClientIDMode值设为Static (ClientIDMode="Static")

其模板中控件TextBox的ClientIDMode值设为Predictable (ClientIDMode="Predictable ")

结果一致“ctrl0_LogoURLTextBox_0” 自动生成ID也不带父容器ID。

最新文章

  1. no module named flask.ext.login
  2. 5、Servlet的使用
  3. 未能加载文件或程序集“System.Data.SQLite”或它的一个依赖。试图加载格式不正确的程序
  4. 速战速决 (2) - PHP: 数据类型 bool, int, float, string, object, array
  5. .NET下金额大小写转换
  6. ChRoomtst
  7. IOS cocos2d笔记1
  8. JAVA_基础面试题
  9. Visual Studio Team Services使用教程--默认团队checkin权限修改
  10. HUST - 1599 Multiple
  11. git push解决办法: ! [remote rejected] master -> master (pre-receive hook declined)
  12. 使用alembic进行数据库版本管理
  13. 一个简单的cmake例子
  14. 有关svn的报错
  15. LeetCode--028--实现strStr() (java)
  16. python两个列表合并为字典,一个作为key,一个作为value
  17. php date_default_timezone_set()设置时区
  18. gitlab 502 报错
  19. 打开Delphi 10.1 berlin提示脚本错误的解决方法
  20. 标准标签、<jsp:include>、<jsp:forward>

热门文章

  1. RPMforge(Repoforge)源
  2. 深入Redis漏斗限流
  3. selenium + js 处理窗口
  4. c 编译异常 switch 之a label can only be part of a statement and a declaration is not a statement
  5. C++调用Fortran程序----动态链接方式
  6. RMI 连接超时时间设定
  7. Marple表演电影字幕
  8. OpenCV学习笔记十五:opencv_features2d模块
  9. Laravel5.1 请求
  10. Android 自定义键盘车牌号输入