Editing a list in a TextBox

Suppose now you want to enter a list of keywords as a comma separated list of words in a single textbox, and then you want to collect all keywords in a IEnumerable property of the View Model of name Keywords:

@Html.PackedListFor(m => m.Keywords, ",")

Also this time not only the helper method converts the IEnumerable into a comma separated list of words, but also it invoke the right handler to recompose back the list in the original format once the View is posted. Other overloads of the helper allow the keyword be rendered into a hidden field, to apply Html attributes and also to use a custom template. 

Last edited Jun 22, 2014 at 10:50 AM by frankabbruzzese, version 5


No comments yet.