473,387 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problems with OutputCache declaration in User Control

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
Nov 18 '05 #1
1 2139
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: julientuhuteru | last post by:
Hi! I'm caching multiple versions of a user control with the following directive in the ascx: <%@ OutputCache Duration="200" VaryByControl="PrgCtrlDropDown" %> "PrgCtrlDropDown" is the ID...
3
by: marshal | last post by:
Hi to All, I am using <% @ OutputCache Duration="60" VaryByParam="none" %> in my usercontrol say "myControl.ascx". This user control has a property say "title". Now am Dynamically Loading...
6
by: Tom Kiefer | last post by:
Question: If I have an ASP.NET User Control which defines/exposes a property that the page can use to specify a mode or data subset for the control to use, is there a way to tell the @OutputCache...
2
by: moondaddy | last post by:
My default page stays constant in the site and all the content in the body of the page is produced with user controls in a table cell for the body section. The main function of this site is a...
0
by: Bob | last post by:
I have several simple user controls (e.g. header, footer) that have static content so I thought it would be a good idea to turn on the ouput cache. So I added <%@ OutputCache Duration="600"...
4
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
0
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
3
by: =?Utf-8?B?TWlndWVsIElzaWRvcm8=?= | last post by:
Hi, I have an ASP.NET 2.0 application that allows content search. Search is included in all pages and a cross postback to the search results page is performed with the text inserted by the user....
0
by: yashgt | last post by:
Hi, I have a user control MyControl.ascx which appears on various pages in my ASP .NET 2.0 application. I have setup partial-page caching using OutputCache directive so that this control gets...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.