Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Cache dropdownlist

Posted on 2011-09-09
5
Medium Priority
?
260 Views
Last Modified: 2012-05-12
How do I cache dropdownlists? For example, I have a "state" table that doesnt change. I bind it to the ddl once. But next time i load the page, i dont want to go back to the database again...

I think i need to use cache["whatever"] but i dont need for example, to cache for a month something...
0
Comment
Question by:Camillia
5 Comments
 
LVL 20

Expert Comment

by:Daniel Van Der Werken
ID: 36511352
There are multiple mechanisms for saving out state for a page in ASP .NET.

Here is an article on how this is done.
http://msdn.microsoft.com/en-us/library/75x4ha6s.aspx

I would say use ViewState["whatever"] = theObject;
0
 
LVL 7

Author Comment

by:Camillia
ID: 36511373
viewstate? then if i close the page, open it again, it will go to the database again. State info is something that won't change that often...
let me look at the link
0
 
LVL 7

Author Comment

by:Camillia
ID: 36511387
that link doesnt mention cache.. i need to cache for like a month..i know i've used it before but cant find a sample code
0
 
LVL 1

Accepted Solution

by:
nakulu earned 1000 total points
ID: 36512019
This might help:

How to: Add Items to the Cache
http://msdn.microsoft.com/en-us/library/18c1wd61.aspx#Y114

0
 
LVL 16

Assisted Solution

by:disrupt
disrupt earned 1000 total points
ID: 36514943
0

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question