subject says it all... wondering if I can pass in a reference to a control on a page so that I can access and manipulate it from within a static method (a Page Method).
I'm guessing no, but looking for confirmation. I did try, and it doesn't seem to work, but that could just be me not doing something right.
Should I give up on finding a way to access my page controls from a 'Page Method'? I can do what I need with parital page post back but I just started using Page Methods for certian scenarios and if I could only access a page control I would be all set
for what I'm trying to accomplish now.
c0pe
Member
319 Points
435 Posts
can you pass a reference to a page control to a 'Page Method' ([WebMethod] and 'static')?
May 08, 2012 10:55 PM|LINK
subject says it all... wondering if I can pass in a reference to a control on a page so that I can access and manipulate it from within a static method (a Page Method).
I'm guessing no, but looking for confirmation. I did try, and it doesn't seem to work, but that could just be me not doing something right.
Should I give up on finding a way to access my page controls from a 'Page Method'? I can do what I need with parital page post back but I just started using Page Methods for certian scenarios and if I could only access a page control I would be all set for what I'm trying to accomplish now.
this:
http://encosia.com/why-do-aspnet-ajax-page-methods-have-to-be-static/
seems to plainly point out that you can't... just want to confirm I'm not missing something before giving up and just taking a different approach.
thanks!
MetalAsp.Net
All-Star
112071 Points
18240 Posts
Moderator
Re: can you pass a reference to a page control to a 'Page Method' ([WebMethod] and 'static')?
May 09, 2012 05:52 AM|LINK
c0pe
Member
319 Points
435 Posts
Re: can you pass a reference to a page control to a 'Page Method' ([WebMethod] and 'static')?
May 09, 2012 05:59 PM|LINK
Thanks MetalAsp.Net. I appreciate it.