SelectExtensions.ListBoxFor Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ListBoxFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>, IDictionary<String,Object>) |
Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. |
ListBoxFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>) |
Returns an HTML select element for each property in the object that is represented by the specified expression and using the specified list items. |
ListBoxFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>, Object) |
Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. |
ListBoxFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>, IDictionary<String,Object>)
Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes.
public static System.Web.Mvc.MvcHtmlString ListBoxFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem> selectList, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member ListBoxFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * seq<System.Web.Mvc.SelectListItem> * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function ListBoxFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), selectList As IEnumerable(Of SelectListItem), htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString
Type Parameters
- TModel
The type of the model.
- TProperty
The type of the property.
Parameters
- htmlHelper
- HtmlHelper<TModel>
The HTML helper instance that this method extends.
- expression
- Expression<Func<TModel,TProperty>>
An expression that identifies the object that contains the properties to display.
- selectList
- IEnumerable<SelectListItem>
A collection of SelectListItem objects that are used to populate the drop-down list.
- htmlAttributes
- IDictionary<String,Object>
An object that contains the HTML attributes to set for the element.
Returns
An HTML select element for each property in the object that is represented by the expression.
Exceptions
The expression
parameter is null.
Applies to
ListBoxFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>)
Returns an HTML select element for each property in the object that is represented by the specified expression and using the specified list items.
public static System.Web.Mvc.MvcHtmlString ListBoxFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem> selectList);
static member ListBoxFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * seq<System.Web.Mvc.SelectListItem> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function ListBoxFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), selectList As IEnumerable(Of SelectListItem)) As MvcHtmlString
Type Parameters
- TModel
The type of the model.
- TProperty
The type of the property.
Parameters
- htmlHelper
- HtmlHelper<TModel>
The HTML helper instance that this method extends.
- expression
- Expression<Func<TModel,TProperty>>
An expression that identifies the object that contains the properties to display.
- selectList
- IEnumerable<SelectListItem>
A collection of SelectListItem objects that are used to populate the drop-down list.
Returns
An HTML select element for each property in the object that is represented by the expression.
Exceptions
The expression
parameter is null.
Applies to
ListBoxFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IEnumerable<SelectListItem>, Object)
Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes.
public static System.Web.Mvc.MvcHtmlString ListBoxFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, System.Collections.Generic.IEnumerable<System.Web.Mvc.SelectListItem> selectList, object htmlAttributes);
static member ListBoxFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * seq<System.Web.Mvc.SelectListItem> * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function ListBoxFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), selectList As IEnumerable(Of SelectListItem), htmlAttributes As Object) As MvcHtmlString
Type Parameters
- TModel
The type of the model.
- TProperty
The type of the property.
Parameters
- htmlHelper
- HtmlHelper<TModel>
The HTML helper instance that this method extends.
- expression
- Expression<Func<TModel,TProperty>>
An expression that identifies the object that contains the properties to display.
- selectList
- IEnumerable<SelectListItem>
A collection of SelectListItem objects that are used to populate the drop-down list.
- htmlAttributes
- Object
An object that contains the HTML attributes to set for the element.
Returns
An HTML select element for each property in the object that is represented by the expression.
Exceptions
The expression
parameter is null.