Search code examples
asp.netweb-parts

Update WebParts through callbacks


I have a page which can contain many WebParts. Each of those WebParts is contained inside an ASPxCallbackPanel from DevExpress so they can load asynchronously, and the user experience doesn't get diminished.

One of those WebParts has an attribute with the "[Personalizable(true)]" attribute, so its content is stored in the WebPart (database). That was working fine when the WebPart was inside an UpdatePanel and asynchronous postbacks were happening, but now with the ASPxCallbackPanel I'm updating the WebPart and that attribute through callbacks, and the attribute isn't being updated in database no longer. What can I do to update a "[Personalizable(true)]" attribute through callbacks?


Solution

  • The SavePersonalizationBlob method (used by the Personalizable Attribute) is called at the rendering stage that does not occur when the callback technology is used (ICallbackEventHandler, ASPxCallbackPanel, etc.). Check the The Concept of Callbacks article for more info. So, consider using the UpdatePanel for this scenario.