Asp Net 1.1, Dynamic loaded User Controls Output Caching

Discussion in 'ASP .Net Web Controls' started by jason, Dec 21, 2006.

  1. jason

    jason Guest

    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.
     
    jason, Dec 21, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marcelo Birnbach [MS]
    Replies:
    0
    Views:
    3,330
    Marcelo Birnbach [MS]
    Jun 28, 2003
  2. Teo Lachev
    Replies:
    0
    Views:
    396
    Teo Lachev
    Jul 1, 2003
  3. Bob Rock
    Replies:
    1
    Views:
    644
    Cowboy \(Gregory A. Beamer\)
    Sep 17, 2006
  4. Ken Fine
    Replies:
    2
    Views:
    590
    Steven Cheng
    Sep 17, 2008
  5. Sven Schimmel

    Caching of dynamic loaded usercontrols

    Sven Schimmel, Jul 31, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    100
    jan v
    Jul 31, 2003
Loading...

Share This Page