cache two usercontrols which contain either menu or treeview will not work?

J

JX

if you cache two usercontrols, and both of which contains either a menu or
treeview, then the first time you get the response right, but on second
reqeust or any later request where the cached content is used, the outout
will not be correct. inspecting the html source, I found some inline style
definition is missing for later response. It seems this is a bug in asp.net
BasePartialCachingControl.PreRenderRecursiveInternal(), where only the last
cached style output is used, and any previous style cache is overwritten.

Any comment or suggestions welcome
JX
 
J

JX

Besides the senerio of two side by side usercontrols being cached, there is
another senerio, suppose one usercontrol uses embedded style(both menu and
treeview use these, and many other ajax controls also use this technique to
inject style definition into the html head element), and it contains a child
usercontrol who is also set to cached, and also uses embedded style, the two
controls expiration event will ussually not coincident, and now suppose that
the parent one is being regenerated while the child one has still a valid
cached version, in this case, since the child one's css settings will go
through the path of page.header.StyleSheet.CSSStyleString (in
BasePartialCachingControl.PreRenderRecursiveInternal), so it will not be
merged with the parent control's css setting, which results an incorrect css
setting string being stored into cache, so any subsequence output of the
parent usercontrol from cache will be incorrect.

Any comment or suggestions welcome.
JX
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top