.net(web) 根据 控件id 获取服务器端控件并进行操作
2015-12-21 13:48
141 查看
html代码:
<input type="hidden" id="hdfFactor1" />
<input type="hidden" id="hdfFactor2" />
<input type="hidden" id="hdfFactor3" />
后台代码:
((HtmlInputHidden)this.Page.FindControl("hdfFactor" + num)).Value
————————————————————————————————
//是个webpage容器
this.Page
//获取一个id为 hdfFactor+num 的控件
this.Page.FindControl("hdfFactor" + num);
//强制转换为Html Input Hidden 控件类型,再进行.value操作。
((HtmlInputHidden)this.Page.FindControl("hdfFactor" + num)).Value
<input type="hidden" id="hdfFactor1" />
<input type="hidden" id="hdfFactor2" />
<input type="hidden" id="hdfFactor3" />
后台代码:
((HtmlInputHidden)this.Page.FindControl("hdfFactor" + num)).Value
————————————————————————————————
//是个webpage容器
this.Page
//获取一个id为 hdfFactor+num 的控件
this.Page.FindControl("hdfFactor" + num);
//强制转换为Html Input Hidden 控件类型,再进行.value操作。
((HtmlInputHidden)this.Page.FindControl("hdfFactor" + num)).Value
相关文章推荐
- Date转换成String
- VS2012 通过 ODBC 连接到SQL SERVER
- 微信app支付php开发
- iOS开发~CocoaPods使用详细说明
- cpu_to_le32()
- redis keys 命令
- 【字符串】poj1961
- this call和apply
- 余额宝 vs. P2P网贷,谁更有生命力?
- Android 打造万能的ListView GridView 适配器
- Android ListView分页显示简单模拟实现
- CentOS 上面安装redis3.0.5
- online_judge_1129
- 素数及素数筛选算法训练基础题(一)
- ABP理论学习之审计日志
- UIView---汇总
- BUAA 更大公约数
- 企业年金
- Jenkins进阶系列之——18Jenkins语言本地化
- 产品策划六:App界面交互设计规范