Asp Net 1.1, Dynamic loaded User Controls Output Caching

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.
 

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

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,689
Members
48,796
Latest member
Greg L.

Latest Threads

Top