I'm having trouble indenting in the Razor MultiSelectBox.
It works fine when I manually write HTML:
<select name="testfoo123" multiple="multiple" size="15"> <option value="PARENT1">Parent</option> <option value="CHILD1"> I am indented</option> <option value="CHILD2"> I am indented</option> <option value="PARENT1">Parent2</option> <option value="CHILD1"> I am indented</option> <option value="CHILD2"> I am indented</option> </select>
Razor's HTML helpers, however, literally display the previous inextricable space in the form. As expected, indentation characters for the indentation are completely ignored.
The code I use to create the multiple select block is as follows:
@Html.ListBoxFor(model => mySelectedValues, new MultiSelectList(myValues), new { size = "15" })
source share