J
jason
hi,
I have a dynamically loaded user control with output caching enabled, it
works fine when a single instance is loaded. However, if I try to
dynamically load two instances of the user control (i.e. different news
content), the last partialcachingcontrol was used for both instances, now
both controls show the last news content.
Here is the code :
============================
protected void LoadUserControl(string ucid)
{
control = LoadControl("NewsContent.ascx");
control.ID = ucid;
Panel1.Controls.Add(control);
NewsContent uc10 = control as NewsContent;
if (uc10 == null)
{
PartialCachingControl pcc = control as PartialCachingControl;
if (pcc != null) uc10 = pcc.CachedControl as NewsContent;
}
if (uc10 != null) uc10.NewsID= int.Parse(ParamArgs[0].ToString());
}
=========================
I am using Asp .net 1.1
Can anyone help? Thanks.
I have a dynamically loaded user control with output caching enabled, it
works fine when a single instance is loaded. However, if I try to
dynamically load two instances of the user control (i.e. different news
content), the last partialcachingcontrol was used for both instances, now
both controls show the last news content.
Here is the code :
============================
protected void LoadUserControl(string ucid)
{
control = LoadControl("NewsContent.ascx");
control.ID = ucid;
Panel1.Controls.Add(control);
NewsContent uc10 = control as NewsContent;
if (uc10 == null)
{
PartialCachingControl pcc = control as PartialCachingControl;
if (pcc != null) uc10 = pcc.CachedControl as NewsContent;
}
if (uc10 != null) uc10.NewsID= int.Parse(ParamArgs[0].ToString());
}
=========================
I am using Asp .net 1.1
Can anyone help? Thanks.