How will I populate a ASP.NET MVC List box?
Make it non selectable?
how will i remove the selected items from the listbox
How will I populate a ASP.NET MVC List box? Make it non selectable? how
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
You want an unselectable select?
The idea is that your model needs to have an
IEnumerable<SelectListItem>that will hold the possible key/value pairs for your selection, here theChoicesMenu. The actual values chosen, if it could be selected, would be posted in theChoicesproperty. Use the signature that allows you to specify html attributes and make it disabled prevent selecting it. You can, of course, do this (or undo it) with javascript.Model:
Action (relevant bit)