Share via


HtmlHelper.ListBox Method

Include Protected Members
Include Inherited Members

Returns an HTML list box control for use in a web page.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public method ListBox(String, IEnumerable<SelectListItem>) Returns an HTML list box control that has the specified name and that contains the specified list items.
Public method ListBox(String, IEnumerable<SelectListItem>, IDictionary<String, Object>) Returns an HTML list box control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items.
Public method ListBox(String, IEnumerable<SelectListItem>, Object) Returns an HTML list box control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items.
Public method ListBox(String, String, IEnumerable<SelectListItem>) Returns an HTML list box control that has the specified name, and that contains the specified list items and default item.
Public method ListBox(String, String, IEnumerable<SelectListItem>, IDictionary<String, Object>) Returns an HTML list box control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items and default item.
Public method ListBox(String, String, IEnumerable<SelectListItem>, Object) Returns an HTML list box control that has the specified name and custom attributes defined by an attribute object, and that contains the specified list items and default item.
Public method ListBox(String, IEnumerable<SelectListItem>, Object, Int32, Boolean) Returns an HTML list box control that has the specified name, size, list items, and default selections, and that specifies whether multiple selections are enabled.
Public method ListBox(String, String, IEnumerable<SelectListItem>, Object, IDictionary<String, Object>) Returns an HTML list box control that has the specified name and custom attributes defined by an attribute dictionary, and that contains the specified list items, default item, and selections.
Public method ListBox(String, String, IEnumerable<SelectListItem>, Object, Object) Returns an HTML list box control that has the specified name, items, default item, and custom attributes defined by an attribute object, and selections.
Public method ListBox(String, String, IEnumerable<SelectListItem>, Object, Int32, Boolean) Returns an HTML list box control that has the specified name, size, items, default item, and selections, and that specifies whether multiple selections are enabled.
Public method ListBox(String, String, IEnumerable<SelectListItem>, Object, Int32, Boolean, IDictionary<String, Object>) Returns an HTML list box control that has the specified name, size, custom attributes defined by an attribute dictionary, items, default item, and selections, and that specifies whether multiple selections are enabled.
Public method ListBox(String, String, IEnumerable<SelectListItem>, Object, Int32, Boolean, Object) Returns an HTML list box control that has the specified name, size, custom attributes defined by an attribute object, items, default item, and selections, and that specifies whether multiple selections are enabled.

Top

Remarks

The HTML list box control is returned as HTML markup that can be used to render the control in a web page.

See Also

Reference

HtmlHelper Class

System.Web.WebPages.Html Namespace