In my pages, the first thing I do when a page is being displayed is query a table called user preferences. I’m doing this for every page and I was wondering what are the options available to avoid repeating this query as the user jumps from page to page on my application.
Thanks.
You should either store the user preference in a Cookie or Session.
Some good reads for you:
http://wiki.asp.net/page.aspx/57/session/
and
http://msdn.microsoft.com/en-us/library/aa289495(v=vs.71).aspx
If both cases, check if the value is not null. If it is not null, use the Cookie or Session value. If it is null, populate your Session / Cookie value with the result of your database call.
This way you will only make this DB call once.