比如在页面中有一个用户控件,用户控件想得到页面中某Label的值(这个Label不在这个用户控件内)怎么做?

((Label)((System.Web.UI.Page)System.Web.HttpContext.Current.Handler).FindControl("test")).Text

(页面中的Label ID="test")

得到页面的其他控件同样道理

比如在页面中有一个用户控件,用户控件想得到页面中某Label的值(这个Label不在这个用户控件内)怎么做?

((Label)((System.Web.UI.Page)System.Web.HttpContext.Current.Handler).FindControl("test")).Text

(页面中的Label ID="test")

得到页面的其他控件同样道理

相关文章:

  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2021-12-24
  • 2021-07-19
  • 2022-01-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
相关资源
相似解决方案