How can this be done? Does this exclu开发者_如何学Cde the UpdatePanel functionality when it's done?
The reason that it supports only static methods is that no page is instantiated. This means that there is no page instance, so of course instance methods cannot be called. This also means that UpdatePanel functionality does not run when you do this.
A workaround is that within your static method you can instantiate the page itself and then do whatever you want. However, keep in mind that things like the page lifecycle won't run.
To get the current context you can use HttpContext.Current
, which is a static property. Once you have that you can access things like session or profile and get information about the state of the site.
If you tell us more about your scenario there might be a better solution.
精彩评论