Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problems with OutputCache declaration in User Control

Reply
Thread Tools

Problems with OutputCache declaration in User Control

 
 
=?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=
Guest
Posts: n/a
 
      10-19-2004
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=
Guest
Posts: n/a
 
      10-20-2004
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

"Barbara Alderton" wrote:

> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bizarre: OutputCache or user control not working yashgt@gmail.com ASP .Net 0 10-02-2007 11:32 AM
Outputcache problems =?Utf-8?B?TWlndWVsIElzaWRvcm8=?= ASP .Net 3 02-16-2007 12:27 PM
How to cancel OutputCache by a user action ? craigkenisston@hotmail.com ASP .Net 3 09-27-2006 10:33 PM
User Control, @OutputCache, and varying the cache by property value Tom Kiefer ASP .Net 6 02-10-2004 04:18 AM
User Control, @OutputCache, and varying the cache by property value Tom Kiefer ASP .Net Web Controls 6 02-10-2004 04:18 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57