近日发现如果在 aspx 页面中定义了带有模板的控件 <ItemTemplate>。则在后台的 aspx.cs 的代码里无法获得在 <ItemTemplate></ItemTemplate> 中定义的服务器控件。只能通过  Container.FindControl() 方法获得这些控件。
    我想这和 <ItemTemplate></ItemTemplate> 中的生命周期有关,具体什么原因还不知道。先记录下来,等以后补充。

var clientid = '<%# (Container.FindControl("hoverMenu") as HoverMenuExtender).BehaviorID %>';

相关文章:

  • 2021-12-27
  • 2021-12-14
  • 2022-02-10
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
  • 2021-12-13
猜你喜欢
  • 2021-11-01
  • 2022-12-23
  • 2021-08-20
  • 2021-11-11
  • 2022-12-23
  • 2021-12-02
  • 2022-02-18
相关资源
相似解决方案