Solved

Cache dropdownlist

Posted on 2011-09-09
5
253 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 250 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 250 total points
ID: 36514943
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

860 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