asp.net mvc binding to listbox
- by ruben
Hi im having trouble displaying data in a mcv website, i end up with selectlistitem displayed on the listbox as opposed to the id or value of the object that i am binding
in my controller
I do this
Authors = new SelectList(_authorRepository.GetAll(), "authorId", "Firstname",null),
and im my View
<%= Html.ListBox("AuthorsList", new SelectList(Model.Authors))%
what else am I missing?