且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何访问静态 Web 方法中的页面控件?

更新时间:2023-12-03 08:58:28

正如@Tim Schmelter 所提到的,这不能回答这个问题,因为您无法从网络方法访问页面控件.

As mentioned by @Tim Schmelter This doesn't answer this question because you can't access page's controls from a webmethod.

请通过asp.net 从静态函数访问控件

[WebMethod] 的全部意义在于它们不运行 ASP.Net 页面生命周期.这样,它们既快速又可并行.您的控件不存在.

The whole point of [WebMethod]s is that they don't run the ASP.Net page lifecycle. This way, they're fast and parallelizable. Your controls don't exist.

您的问题与如何在静态网络方法中获取控件重复一个>