开发者

PageMethods and page controls reference

I'm using pagemethods to call a method from javascript, is there a way to access the page's controls from the method in codebehind (marked as static)? The problem is that the pagemethod nedds to load a business entity 开发者_JS百科and load it to the page, and the structure is complex.

Thanks in advance for any help.


Even in a static/shared method you can access your page.

C#:

(WebForm1)HttpContext.Current.Handler

VB.Net:

DirectCast(HttpContext.Current.Handler, WebForm1)

Where WebForm1 is your page-type. Then you can access all your controls.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜