记录一下,主要是这句:
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();
}



