Solved

Cache dropdownlist

Posted on 2011-09-09
5
249 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 19

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now