Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 346213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:09:22+00:00 2026-05-12T11:09:22+00:00

I am new to ASP.NET, experienced with WinForms and WPF. Go easy on me.

  • 0

I am new to ASP.NET, experienced with WinForms and WPF. Go easy on me.

When my page loads, it hits the database and queries a table for choices to put in a drop down list. Now if you do a postback on the page, do you reload the values in the form_load? It seems unnecessary to hit the database twice. My assumption is that I put the form_load, I hit the database for the enums, then fill the drop down with the values I found.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:09:22+00:00Added an answer on May 12, 2026 at 11:09 am

    I assume you’re talking about a “lookup table”, basically something that has a schema of {Id, Name} and is referenced as a foreign key from another table, correct?

    This is an age-old question, and there’s no “right” answer.

    If your enumeration is likely to change at all (perhaps it’s controlled by an administrative user), you won’t be able to use @Andrei Rinea’s suggestion, as you’ll need to refresh the value from the database. Ultimately, you’ll be best off doing as Keltex suggests and Cache the results with a short expiration — probably as little as 5 minutes. Just that small amount of caching could increase performance quite a bit, if you’re under a heavy load.

    If your enumeration is unlikely to change… particularly if it’s not modifiable through the UI by an administrator, there’s a fun trick that I like to do, which is to map the enumeration to an actual C# enumeration, with the value of the enum tied directly to the primary key of the enumeration table. In this way, you never have to hit the database at all to get a list of possible values.

    The drawback to this trick is that a new enumeration item requires a new compilation of your code and a new deployment. This may or may not be ideal, so use the trick with caution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a new ASP.NET MVC application. The home page looks like this: I
I am new to ASP.NET / .net, i have designed the screens and database
I'm new to classic asp, all my experience is in c# .net and ColdFusion
New ASP.NET Web API HttpClient has been giving me some strange results. Here is
I am a new ASP.NET developer and I am developing a web-based suggestions box
I am building a new asp.net MVC3 web application for reporting and I want
I've created a new ASP.NET Web Site in VS2008. I'm attempting to rebuild an
I have a new asp.net mvc project and i am trying to figure out
I'm planning a new ASP.NET project that will become a product that is installed
I am researching a new ASP.Net project that we would like to host in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.