InputExtensions.TextBoxFor Method

 

Returns a text input element for each property in the object that is represented by the specified expression.

Namespace:   System.Web.Mvc.Html
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Overload List

Name Description
System_CAPS_pubmethodSystem_CAPS_static 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.

System_CAPS_pubmethodSystem_CAPS_static 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.

System_CAPS_pubmethodSystem_CAPS_static 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.

System_CAPS_pubmethodSystem_CAPS_static TextBoxFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, String)

Returns a text input element.

System_CAPS_pubmethodSystem_CAPS_static TextBoxFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, String, IDictionary<String, Object>)

Returns a text input element.

System_CAPS_pubmethodSystem_CAPS_static TextBoxFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, String, Object)

Returns a text input element.

See Also

InputExtensions Class
System.Web.Mvc.Html Namespace

Return to top

InputExtensions.TextBoxFor<TModel, TProperty> Method (HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>)

Returns a text input element for each property in the object that is represented by the specified expression.

Syntax

public static MvcHtmlString TextBoxFor<TModel, TProperty>(
    this HtmlHelper<TModel> htmlHelper,
    Expression<Func<TModel, TProperty>> expression
)
public:
generic<typename TModel, typename TProperty>
[ExtensionAttribute]
static MvcHtmlString^ TextBoxFor(
    HtmlHelper<TModel>^ htmlHelper,
    Expression<Func<TModel, TProperty>^>^ expression
)
static member TextBoxFor<'TModel, 'TProperty> : 
        htmlHelper:HtmlHelper<'TModel> *
        expression:Expression<Func<'TModel, 'TProperty>> -> MvcHtmlString
<ExtensionAttribute>
Public Shared Function TextBoxFor(Of TModel, TProperty) (
    htmlHelper As HtmlHelper(Of TModel),
    expression As Expression(Of Func(Of TModel, TProperty))
) As MvcHtmlString

Parameters

Return Value

Type: System.Web.Mvc.MvcHtmlString

An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression.

Type Parameters

  • TModel
    The type of the model.
  • TProperty
    The type of the value.

Exceptions

Exception Condition
ArgumentException

The expression parameter is null or empty.

Return to top

InputExtensions.TextBoxFor<TModel, TProperty> Method (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.

Syntax

public static MvcHtmlString TextBoxFor<TModel, TProperty>(
    this HtmlHelper<TModel> htmlHelper,
    Expression<Func<TModel, TProperty>> expression,
    IDictionary<string, object> htmlAttributes
)
public:
generic<typename TModel, typename TProperty>
[ExtensionAttribute]
static MvcHtmlString^ TextBoxFor(
    HtmlHelper<TModel>^ htmlHelper,
    Expression<Func<TModel, TProperty>^>^ expression,
    IDictionary<String^, Object^>^ htmlAttributes
)
static member TextBoxFor<'TModel, 'TProperty> : 
        htmlHelper:HtmlHelper<'TModel> *
        expression:Expression<Func<'TModel, 'TProperty>> *
        htmlAttributes:IDictionary<string, Object> -> MvcHtmlString
<ExtensionAttribute>
Public Shared 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

Parameters

Return Value

Type: System.Web.Mvc.MvcHtmlString

An HTML input element type attribute is set to "text" for each property in the object that is represented by the expression.

Type Parameters

  • TModel
    The type of the model.
  • TProperty
    The type of the value.

Exceptions

Exception Condition
ArgumentException

The expression parameter is null or empty.

Return to top

InputExtensions.TextBoxFor<TModel, TProperty> Method (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.

Syntax

public static MvcHtmlString TextBoxFor<TModel, TProperty>(
    this HtmlHelper<TModel> htmlHelper,
    Expression<Func<TModel, TProperty>> expression,
    object htmlAttributes
)
public:
generic<typename TModel, typename TProperty>
[ExtensionAttribute]
static MvcHtmlString^ TextBoxFor(
    HtmlHelper<TModel>^ htmlHelper,
    Expression<Func<TModel, TProperty>^>^ expression,
    Object^ htmlAttributes
)
static member TextBoxFor<'TModel, 'TProperty> : 
        htmlHelper:HtmlHelper<'TModel> *
        expression:Expression<Func<'TModel, 'TProperty>> *
        htmlAttributes:Object -> MvcHtmlString
<ExtensionAttribute>
Public Shared Function TextBoxFor(Of TModel, TProperty) (
    htmlHelper As HtmlHelper(Of TModel),
    expression As Expression(Of Func(Of TModel, TProperty)),
    htmlAttributes As Object
) As MvcHtmlString

Parameters

  • htmlAttributes
    Type: System.Object

    An object that contains the HTML attributes to set for the element.

Return Value

Type: System.Web.Mvc.MvcHtmlString

An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression.

Type Parameters

  • TModel
    The type of the model.
  • TProperty
    The type of the value.

Exceptions

Exception Condition
ArgumentException

The expression parameter is null or empty.

Return to top

InputExtensions.TextBoxFor<TModel, TProperty> Method (HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, String)

Returns a text input element.

Syntax

public static MvcHtmlString TextBoxFor<TModel, TProperty>(
    this HtmlHelper<TModel> htmlHelper,
    Expression<Func<TModel, TProperty>> expression,
    string format
)
public:
generic<typename TModel, typename TProperty>
[ExtensionAttribute]
static MvcHtmlString^ TextBoxFor(
    HtmlHelper<TModel>^ htmlHelper,
    Expression<Func<TModel, TProperty>^>^ expression,
    String^ format
)
static member TextBoxFor<'TModel, 'TProperty> : 
        htmlHelper:HtmlHelper<'TModel> *
        expression:Expression<Func<'TModel, 'TProperty>> *
        format:string -> MvcHtmlString
<ExtensionAttribute>
Public Shared Function TextBoxFor(Of TModel, TProperty) (
    htmlHelper As HtmlHelper(Of TModel),
    expression As Expression(Of Func(Of TModel, TProperty)),
    format As String
) As MvcHtmlString

Parameters

  • format
    Type: System.String

    A string that is used to format the input.

Return Value

Type: System.Web.Mvc.MvcHtmlString

An input element whose type attribute is set to "text".

Type Parameters

  • TModel
    The type of the model.
  • TProperty
    The type of the value.

Return to top

InputExtensions.TextBoxFor<TModel, TProperty> Method (HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, String, IDictionary<String, Object>)

Returns a text input element.

Syntax

public static MvcHtmlString TextBoxFor<TModel, TProperty>(
    this HtmlHelper<TModel> htmlHelper,
    Expression<Func<TModel, TProperty>> expression,
    string format,
    IDictionary<string, object> htmlAttributes
)
public:
generic<typename TModel, typename TProperty>
[ExtensionAttribute]
static MvcHtmlString^ TextBoxFor(
    HtmlHelper<TModel>^ htmlHelper,
    Expression<Func<TModel, TProperty>^>^ expression,
    String^ format,
    IDictionary<String^, Object^>^ htmlAttributes
)
static member TextBoxFor<'TModel, 'TProperty> : 
        htmlHelper:HtmlHelper<'TModel> *
        expression:Expression<Func<'TModel, 'TProperty>> *
        format:string *
        htmlAttributes:IDictionary<string, Object> -> MvcHtmlString
<ExtensionAttribute>
Public Shared 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

Parameters

  • format
    Type: System.String

    A string that is used to format the input.

Return Value

Type: System.Web.Mvc.MvcHtmlString

An input element whose type attribute is set to "text".

Type Parameters

  • TModel
    The type of the model.
  • TProperty
    The type of the value.

Return to top

InputExtensions.TextBoxFor<TModel, TProperty> Method (HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, String, Object)

Returns a text input element.

Syntax

public static MvcHtmlString TextBoxFor<TModel, TProperty>(
    this HtmlHelper<TModel> htmlHelper,
    Expression<Func<TModel, TProperty>> expression,
    string format,
    object htmlAttributes
)
public:
generic<typename TModel, typename TProperty>
[ExtensionAttribute]
static MvcHtmlString^ TextBoxFor(
    HtmlHelper<TModel>^ htmlHelper,
    Expression<Func<TModel, TProperty>^>^ expression,
    String^ format,
    Object^ htmlAttributes
)
static member TextBoxFor<'TModel, 'TProperty> : 
        htmlHelper:HtmlHelper<'TModel> *
        expression:Expression<Func<'TModel, 'TProperty>> *
        format:string *
        htmlAttributes:Object -> MvcHtmlString
<ExtensionAttribute>
Public Shared 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

Parameters

  • format
    Type: System.String

    A string that is used to format the input.

  • htmlAttributes
    Type: System.Object

    An object that contains the HTML attributes to set for the element.

Return Value

Type: System.Web.Mvc.MvcHtmlString

An input element whose type attribute is set to "text".

Type Parameters

  • TModel
    The type of the model.
  • TProperty
    The type of the value.

Return to top