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

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -