I need to fill a dropdownlist with values from a settings table in a database.
(id int, code string, description string, value string)
1 , 1 , “something” , “This1”
2 , 1 , “this too” , “This2”
3 , 2 , “something else” , “This2”
n , x , and so on…….
Now I only want to fill the dropdownlist with code 1 (I want to use this on a lot of pages.)
How can I do this?? url to a tutorial or something like is also ok!
btw I am using mvc3.
cheers
If regular dropdown than as below
If using MVC ?
http://www.c-sharpcorner.com/UploadFile/2124ae/5628/
Create a Dropdown List for MVC3 using Entity Framework (.edmx Model) & Razor Views && Insert A Database Record to Multiple Tables