D
DC
Hi,
we are dynamically adding webcontrols in a page like so:
Type t = Type.GetType("controls.namespace.control, controls.namespace",
false, true);
Control c = (Control)Activator.CreateInstance(t, true);
this.Controls.Add(c);
Now we would like to cache this webcontrol.
Using the same approach with user controls makes caching easier since
..LoadControl will return a PartialCachingControl which is "ready for
caching". Is there a similar approach for webcontrols?
When I simply cache control c in the example above I can reuse it, but
when multiple threads are adding such cached controls to their control
tree then the CreateChildControls process will throw exceptions (since
the same instance of one controls is being used simultaneously in
multiply control trees - I guess).
TIA for any idea!
Regards
DC
we are dynamically adding webcontrols in a page like so:
Type t = Type.GetType("controls.namespace.control, controls.namespace",
false, true);
Control c = (Control)Activator.CreateInstance(t, true);
this.Controls.Add(c);
Now we would like to cache this webcontrol.
Using the same approach with user controls makes caching easier since
..LoadControl will return a PartialCachingControl which is "ready for
caching". Is there a similar approach for webcontrols?
When I simply cache control c in the example above I can reuse it, but
when multiple threads are adding such cached controls to their control
tree then the CreateChildControls process will throw exceptions (since
the same instance of one controls is being used simultaneously in
multiply control trees - I guess).
TIA for any idea!
Regards
DC