10/26/2011 6:29:06 AM
Caching is not working correctly when setting web part properties dynamically.
In the aspx template engine, we have cerated a template page that contains a webpart (cmsrepeater). We want to set the properties of that webpart either in the aspx's code behind or by using code blocks in the html of the aspx page.
In order to do this, we have used the method described in developer guide "Setting web part properties dynamically in your code". We have set the properties of the webpart in the oninit event of the aspx page and then called ReloadData() method of the webpart. This displays the correct data, but the caching mechanism ignores the properties set in the oninit event. The data stored in the cache are based on the default properties of the webpart.
What is the correct way to set webpart properties dynamically and keep the caching mechanism working correctly?