且构网

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

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

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

正如@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.

您的问题是如何在静态网络方法中获取控件的重复项a>