asp.net - custom input instead of @Html.Editorfor -


i use @html.editorfor(model=> model.score) in "create" view write

    <select>       <option value="1">1</option>       <option value="2">2</option>       <option value="3">3</option>       <option value="4">4</option>       <option value="5">5</option>                                </select> 

but how connect select write model.score ???

you should use dropdownlistfor instead of editorfor.

in case be:

@html.dropdownlistfor(m => m.selectedscore, model.possiblescores)  

where names self-described.

an example of usage


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -