//ListView(ID:lvInfos),i为行索引 (lvInfos.Items[index].FindControl("Num") as TextBox).Enable=false; //GridView(ID:gvInfos),i为行索引 (gvInfos.Rows[index].FindControl("Num") as TextBox).Enable=false;
注释有错误,纠正下 index 为行索引
你看下apsx的头是不是出问题了
一般用Master, PanelD等控件都会改变里面控件的HTML Id 两种方法解决 1.直接看生成的html代码,会在你控件前加个前缀 2. 控件属性里把clienid 属性射程Static这样生成的控件在HTML里的id就不会变了
//ListView(ID:lvInfos),i为行索引
(lvInfos.Items[index].FindControl("Num") as TextBox).Enable=false;
//GridView(ID:gvInfos),i为行索引
(gvInfos.Rows[index].FindControl("Num") as TextBox).Enable=false;
注释有错误,纠正下 index 为行索引
两种方法解决
1.直接看生成的html代码,会在你控件前加个前缀
2. 控件属性里把clienid 属性射程Static这样生成的控件在HTML里的id就不会变了