How to read the selected items in an Html.ListBox at postback time
Posted
by EasyTimer
on Stack Overflow
See other posts from Stack Overflow
or by EasyTimer
Published on 2010-04-13T14:50:37Z
Indexed on
2010/04/13
14:52 UTC
Read the original article
Hit count: 334
asp.net-mvc
|listbox
I have a search page on my MVC site that contains a list of strings that I think the user might wish to search for in my database. This list of strings is available in my model class, so I can populate an Html.ListBox with those strings thus:
<%=Html.ListBox("SearchStrings", new SelectList(Model.SearchStrings)) %>
My problem is, how can I tell which strings the user selected in that list in my postback action?
Any help would be most appreciated.
© Stack Overflow or respective owner