In adding controls on the fly, if you have a cached control in the page and wanna add another instance of control to page you got an error. (add control with LoadControl)
The error occured when you wanna load a control and try to definesome control parameters.Strangely, the control type will change to PartialCachingControl! and the real type accessible by CachedControl (you must add control to your page or placeholder first. It takes one hour to uderstand!). Cast the control with PartialCachingControl and get the CachedControl property.
The second note is that you can not set parameter of cached control if you have already a cached control with same parameters (you got silly error!). You must check this with CachedControl. If CachedControl of a control is null it means that control is already cached and you can not change the parameters.