开发者

ASP.Net Web Parts, personalization, and javascript

开发者 https://www.devze.com 2023-04-08 14:29 出处:网络
Folks, I have some personalized properties on an ASP.Net Web Part that I would like to set via Ajax (for example, the size to which the user has expanded the WebPart using the jQuery Resizable plugin.

Folks,

I have some personalized properties on an ASP.Net Web Part that I would like to set via Ajax (for example, the size to which the user has expanded the WebPart using the jQuery Resizable plugin.)

I've read this question and answer, but I don't think it will work. Personalized properties are instance properties. (If they were static, they couldn't be user-scoped, could they?) A WebMethod, which must be static, can't access them.

You might be thinking that I could just use a hidden field and send my values back that way, but that assumes that a postback is done at least once after the values are set. In this case I can't guarantee that: the page in question displays a lot of data but doesn't take any user input other than for configuration.

I seem to recall that some Ajax techniques involve remotely instantiating a page on the server and going through at least part of the pa开发者_如何学Pythonge life cycle, but the last time I messed with that was 2006 and I never could get it to work very well. I have the impression that modern Ajax techniques, even for ASP.Net, work in other ways.

So, does anybody have an idea of how this could be managed?

Thanks very much,

Ann L.


Webmethods only have to be static when they are page-based. Create a webservice in your project and stick non-static webmethods in there. You can even enable session state.

0

精彩评论

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