InputExtensions.TextBoxFor 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
TextBoxFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String)
Returns a text input element.
public static System.Web.Mvc.MvcHtmlString TextBoxFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, string format);
static member TextBoxFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * string -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function TextBoxFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), format As String) As MvcHtmlString
Type Parameters
- TModel
The type of the model.
- TProperty
The type of the value.
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.
- format
- String
A string that is used to format the input.
Returns
An input element whose type attribute is set to "text".
Applies to
TextBoxFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, Object)
Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
public static System.Web.Mvc.MvcHtmlString TextBoxFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, object htmlAttributes);
static member TextBoxFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function TextBoxFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), htmlAttributes As Object) As MvcHtmlString
Type Parameters
- TModel
The type of the model.
- TProperty
The type of the value.
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 render.
- htmlAttributes
- Object
An object that contains the HTML attributes to set for the element.
Returns
An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression.
Exceptions
The expression
parameter is null or empty.
Applies to
TextBoxFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, IDictionary<String,Object>)
Returns a text input element.
public static System.Web.Mvc.MvcHtmlString TextBoxFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, string format, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member TextBoxFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * string * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function TextBoxFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), format As String, htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString
Type Parameters
- TModel
The type of the model.
- TProperty
The type of the value.
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.
- format
- String
A string that is used to format the input.
- htmlAttributes
- IDictionary<String,Object>
An object that contains the HTML attributes to set for the element.
Returns
An input element whose type attribute is set to "text".
Applies to
TextBoxFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>)
Returns a text input element for each property in the object that is represented by the specified expression.
public static System.Web.Mvc.MvcHtmlString TextBoxFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression);
static member TextBoxFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function TextBoxFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty))) As MvcHtmlString
Type Parameters
- TModel
The type of the model.
- TProperty
The type of the value.
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 render.
Returns
An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression.
Exceptions
The expression
parameter is null or empty.
Applies to
TextBoxFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, IDictionary<String,Object>)
Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes.
public static System.Web.Mvc.MvcHtmlString TextBoxFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member TextBoxFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function TextBoxFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString
Type Parameters
- TModel
The type of the model.
- TProperty
The type of the value.
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 render.
- htmlAttributes
- IDictionary<String,Object>
A dictionary that contains the HTML attributes to set for the element.
Returns
An HTML input element type attribute is set to "text" for each property in the object that is represented by the expression.
Exceptions
The expression
parameter is null or empty.
Applies to
TextBoxFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, Object)
Returns a text input element.
public static System.Web.Mvc.MvcHtmlString TextBoxFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, string format, object htmlAttributes);
static member TextBoxFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * string * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function TextBoxFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), format As String, htmlAttributes As Object) As MvcHtmlString
Type Parameters
- TModel
The type of the model.
- TProperty
The type of the value.
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.
- format
- String
A string that is used to format the input.
- htmlAttributes
- Object
An object that contains the HTML attributes to set for the element.
Returns
An input element whose type attribute is set to "text".