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
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