Caching parsed child elements

T

Tom

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
 

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

Forum statistics

Threads
474,056
Messages
2,570,443
Members
47,089
Latest member
Bobby2025b

Latest Threads

Top