Problems with OutputCache declaration in User Control

G

Guest

I have the following scenario:

I have a user control that contains a registered menu control. The menu and
other information on the user control is specific to the user accessing the
site. This user control is used on many pages. In order to create this
control, I need to access information in the Active Directory to create both
the menu and other info displayed on the control.

This access takes some time and I wanted to cache this info the first time
the control is accessed and save it for access to additional pages with the
control, to speed things up. I was originally looking at cache namespace but
from what I understand, this caching is more for application wide issues.
This data is user specific (session specific).

I have been trying to use the <%@ OutputCache ......... %> declaration on
the user control page. But it has trouble after the first access (when
accessing cache), getting a unknown object error. The menu is registered to
the page. I read about the following issue that may be similar (someone
accessing a javascript ‘page’ declarative):

Since the control is loaded from cache there is no way that the code will
load as well since it's in a different container: the page instead of the
user control.

The suggestion was to put the script block inside the user control's
container.

If this can be done, how is this done? If not, does anyone having
suggestions on obtaining the results I want even if doesn't entail using the
OutputCache declarative.

Thanks,
Barbara Alderton
 
G

Guest

I decided to drop the <%@ OutputCache ......... %> usage.

Instead I retrieve the information at Session_start and store in an
arraylist of records (class definition). Then in the user control I access
the data in the arraylist to build the menu. Speeds things up dramatically.

Barbara Alderton
 

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
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top