Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / September 2003

Tip: Looking for answers? Try searching our database.

Control Caching Problem - HELP!?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stewart - 16 Sep 2003 07:14 GMT
Hi all, hoping one of you may be able to throw up an idea on the
following.  I have an asp.net page with a drop-down and a user control
inside.  The user control should be cached in one way or another as it
takes a lot of database work to produce.

-----------------------------------------
|                                       |
|       DROP DOWN V                     |
|                                       |
|       ------------------              |
|       |                |              |
|       |  USER CONTROL  |              |
|       |                |              |
|       ------------------              |
|                                       |
|                                       |
|                                       |
-----------------------------------------

Now the problem I am having is that the contents of the drop down
changes from time to time.  This prevents us from caching the whole
page for any significant amount of time.  The data accessed by the
user control is different depending on the setting of the drop down.
My question is how do I cache the user control output (with a
different version for each drop-down value)?

I've tried:
1)  Using VaryByParam, but the default page has no param and hence if
the default selected item in the drop down changes, the user control's
cached output does not.
2)  Tried VaryByControl.  For this to work the control in question (ie
the dropdown) actually needs to be part of the user control.  If we
made it so then we could not update the contents of the dropdown (as
it is cached).

Ideas?

Thanks,

Stewart
Kevin Spencer - 16 Sep 2003 13:11 GMT
I don't see why you should cache the User Control. Just cache the data that
takes so long to retrieve from the database, and re-load it into the User
Control with each PostBack. If you brought a gallon of ice cream home in
your car, you wouldn't put the car in the freezer, would you?

Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

> Hi all, hoping one of you may be able to throw up an idea on the
> following.  I have an asp.net page with a drop-down and a user control
[quoted text clipped - 36 lines]
>
> Stewart

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.