0

I want to create a static dropdownlist as such

@Html.dropdownlist("Category", new List<SelectListItem>
{
new SelectListItem{value = "1", Text = "All"},
new SelectListItem{value = "2", Text = "Amy" }
})

I want to map this category to my object class so that I am able to access that attribute when running the query at my query page and do a switch-case in order to do different things based on different dropdownlist items selected.

Please help.

Thanks in advance.

Amy
  • 45
  • 1
  • 1
  • 9
  • See http://stackoverflow.com/questions/7142961/mvc3-dropdownlistfor-a-simple-example for a starting point. – R Day Dec 08 '15 at 10:24
  • @Rday okay i used that piece of codes but I am only getting a count for that even when i select option 2. How do i get the option 2 value id? – Amy Dec 09 '15 at 01:57
  • can you include your model class and action method? It could be a binding issue. – R Day Dec 09 '15 at 08:52

0 Answers0