Caching parsed child elements

Discussion in 'ASP .Net Building Controls' started by Tom, Jan 8, 2009.

  1. Tom

    Tom Guest

    Hi,

    A slightly complex one, I hope I explain it clearly...

    I have a usercontrol which use the ParseChildren(False) and
    ControlBuilder attributes.
    The usercontrol is called from the parent page using the following
    example...
    <uc1:Menu>
    <MenuItem Title="First Item"/>
    <MenuItem Title="Sub Menu Header"><MenuItem Title="Sub Menu Item"/></
    MenuItem>
    <MenuItem Title="Last Item"/>
    </uc1:Menu>

    Everything is working fine - the usercontrol is calling the
    AddParsedSubObject, the GetChildControlType of the Builder is being
    called, the MenuItem objects are created with all their attributes...
    all hunky-dory.
    (Although I don't quite understand exactly when the system calls
    GetChildControlType, as it doesn't always appear to break-point when
    I'd expect it to!)

    My question is whether it is possible to cache those MenuItem objects,
    and use them instead of the AddParsedSubObject being called every
    single time the page is loaded.
    The menus I have are quite large, and it's a waste of processing to
    create the MenuItems objects everytime.

    Any help, or suggestions of different approaches, very welcome :)

    Cheers,
    Tom
    Tom, Jan 8, 2009
    #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. Hypo
    Replies:
    6
    Views:
    397
  2. Troy Simpson

    Fragment Caching inside page caching?

    Troy Simpson, Jan 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    773
    Troy Simpson
    Jan 19, 2004
  3. Gerald Aichholzer
    Replies:
    2
    Views:
    2,483
    Gerald Aichholzer
    Jun 27, 2006
  4. Jeff Rodriguez
    Replies:
    23
    Views:
    1,093
    David Schwartz
    Dec 9, 2003
  5. JimLad
    Replies:
    3
    Views:
    905
    JimLad
    Jan 21, 2010
Loading...

Share This Page