您现在的位置是:网站首页> 编程资料编程资料
Repeater事件OnItemCommand取得行内控件的方法_实用技巧_
2023-05-25
532人已围观
简介 Repeater事件OnItemCommand取得行内控件的方法_实用技巧_
记录一下,主要是这句:
TextBox txtNum = e.Item.FindControl("txtNum") as TextBox;
Repeater真是太强了,太灵活。除了Repeater别的都不用。
复制代码 代码如下:
复制代码 代码如下:
protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
{
switch (e.CommandName)
{
case "update":
string arg = e.CommandArgument.ToString();//取得参数
//找到激发事件的行内控件,这个很有用,能将更多需要的参数值传递过来。
TextBox txtNum = e.Item.FindControl("txtNum") as TextBox;
//下面执行业务逻辑
string jsStr = "";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", jsStr,false);
break;
}
Bind();
}
您可能感兴趣的文章:
- Repeater控件与PagedDataSource结合实现分页功能
- Repeater控件实现编辑、更新、删除等操作示例代码
- Repeater怎么实现多行间隔显示分隔符
- Repeater中嵌套Repeater的示例介绍
- repeater做删除前弹窗询问实例
- 给Repeater控件里添加序号的5种才常见方法介绍
- asp.net Repeater 数据绑定的具体实现(图文详解)
- Repeater控件绑定的三种方式
- ASP.NET笔记之 Repeater的使用
- asp.net Repeater分页实例(PageDataSource的使用)
- Repeater里switch的使用方法
- Repeater中添加按钮实现点击按钮获取某一行数据的方法
相关内容
- 利用sender的Parent获取GridView中的当前行(获取gridview的值)_实用技巧_
- asp.net2.0中css失效的解决方法_实用技巧_
- gridview自动排序示例分享_实用技巧_
- VS2005打开VS2008项目的2种方法(vs2005怎么打开2008)_实用技巧_
- asp.net解决上传4M文件限制_实用技巧_
- .net 添加Cookie的4种方法_实用技巧_
- asp.net后台如何输出js脚本使用什么方法可以实现_实用技巧_
- asp.net post方法中参数取不出来的解决方法_实用技巧_
- asp.net DataSet转换成josn并输出示例_实用技巧_
- 用存储过程向数据库存值的具体实现_实用技巧_
