使用了母版页之后生成的html控件ID与html控件直接生成的控件ID不同,控件的id属性被无缘无故了加上了ctl00_MainContent_前缀,其name属性也加上了ctl00$MainContent$前缀。

而其他数据绑定控件也会在前台生成的html控件名按一定格式重新命名了控件ID和name

如在DataList的update按钮,你外部这个按钮代码模仿下面的,在cs里生成这个按钮
<input   type= "submit "   name= "DataList1:_ctl1:btnUpdate "   value= "更新 "   id= "DataList1__ctl1_btnUpdate ">

id和name原则是:
DataList1:DataList的ID
_ctl1:所编辑的行,第二行就是_ctl2
btnUpdate:你在DataList的update按钮的ID

你在DataList的update按钮可以隐藏,用外面那个你的按钮控制更新

相关文章:

  • 2022-12-23
  • 2021-09-01
  • 2021-05-02
  • 2021-08-01
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2021-07-30
猜你喜欢
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
  • 2022-02-07
  • 2022-01-03
  • 2021-07-15
  • 2021-10-15
相关资源
相似解决方案