4

We have a site (actually an Application Builder) that rendered a lot of user controls in different scenarios,

One day the manager decided to add Output cache in the main page,

OK, every things is fine and the request responded very fast!

But in the other hand this caching have some troubles:

Assume we have an InsertForm User control that filled some entities, and a ListForm User Control that display list of entities, So you can guess what happen, the entities filled correctly but not shown in List, why? because of output caching.

Then we must exclude this user controls from caching, after some search we find Donut Caching, and it seems very well,

We use Add dynamically server control to Substitution

Most of user controls implementations depend of all page life cycle, some of them do in Init, some in Load some of them in Render, so in most scenarios we have a place holder, what we do is:

enter image description here

enter image description here

And in PreRender remove all controls from placeHolder to prevent of duplication:

enter image description here

in some cases we have a good result But in some implementation again we have troubles, all of the Request replaced with HttpContext.Current.Request and all of the Sessions converted to fields, but in some cases like use Wizard we still have exception: Request does not exist in this context. And in bind events we have troubles again, the events not bind correctly, like the wizard next button click event.

After all I fill we are in wrong way, maybe this is not practical in this scenario,

what do you think?

do we have another option?

or all of this troubles are solvable? any suggestion please?

Community
  • 1
  • 1
Saeid
  • 13,224
  • 32
  • 107
  • 173

1 Answers1

-1

see if these works for you

here is a similar solution

Ratna
  • 2,289
  • 3
  • 26
  • 50