Building a SelectList

Example Select Lists

 

@( Html.BuildDropDownList("ICanHasQuestion").
        OptionLabel("-- what is your answer --").
        SelectList(list => {
            list.Add("Yes", Boolean.TrueString);
            list.Add("No", Boolean.FalseString);
        }))

 

ListSize() - Sets the "size" attribute which determines how many lines to display.

SelectList() - Sets the select list for the drop down list.

OptionLabel() - Sets the option label

Multiple() - Sets the "multiple" attribute which enables multiple selection.

Last edited Aug 26, 2012 at 8:22 AM by grcodemonkey, version 2

Comments

No comments yet.