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 6236689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:53:30+00:00 2026-05-24T10:53:30+00:00

Hi, Say that I create a webpage where the users can set diffrent filters

  • 0

Hi,

Say that I create a webpage where the users can set diffrent filters on the front page. Some of the filters is dropdowns or selectlists (these controls contains option emelents that holds value and text).

<select>
<option value="">Miles</option>
<option value="0">100 miles</option>
<option value="1">200 miles</option>
<option value="2">300 miles</option>
</select>

This could also involve countries, cities and so on.

The text is just for display but the value are to be mapped to somekind of object on the server side.

The question is if the value should be a Id of the choosen object or if it should just be the selected index?

  • If we use Id it could mean that we get large numbers after a while if the mata data changes much, the id of one option could for example be 32000. The god thing with this is that it will never be a problem to know what value the user have choosen.

  • If we instead take the list of choises on the server and order it by a given property, after this we generate a value/id starting from 0 and up. This will make the HTML look bether and we will never have to think about to much changes in the meta data that results in high values. The problem is when mapping it to the object on the server side, we will have to order the list again(maby cached to avoid this) and then check the match. Another problem here would be if the meta data is changed so even if the user have selected index 3 that is object with id 2304 he will instead get object with the id 2302.

I have looked at a couple of pages but when it is about filters like miles and years it seemse like thay count indexes starting from 0 (my second choise) :

  • 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-24T10:53:31+00:00Added an answer on May 24, 2026 at 10:53 am

    usually you want the value to be the key to the element in the database, that way you know it won’t change. It doesn’t matter if the value can be big, since it’s really a string (so value=”388283″ is not any bigger than value=”orange”)

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

Sidebar

Related Questions

There are other posts that say you can create a control in windows forms
I know that I can have some HTTP request, say post , for some
Let's say that I create a Sub (not a function) whose mission in life
Lets say that I'm trying to create a new process with the following code:
Let's say that you want to create a dead simple BlogEditor and, one of
Let's say that I have a Flash website where you could create an avatar
First, we create classes that represent db entities, ok, done. Let's say we use
Say you create a form using ASP.NET MVC that has a dynamic number of
I'm trying to create a <table> that doesn't exceed a certain width (let's say
I have an ASP.NET forms app that allows users to run some management reports.

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.