Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticTextBoxFor<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_staticTextBoxFor<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_staticTextBoxFor<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_staticTextBoxFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, String)

Returns a text input element.

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

Returns a text input element.

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

Returns a text input element.

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.

public static MvcHtmlString TextBoxFor<TModel, TProperty>(
	this HtmlHelper<TModel> htmlHelper,
	Expression<Func<TModel, TProperty>> expression
)

Parameters

htmlHelper
Type: System.Web.Mvc.HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Type: System.Linq.Expressions.Expression<Func<TModelTProperty>>

An expression that identifies the object that contains the properties to render.

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.

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.

public static MvcHtmlString TextBoxFor<TModel, TProperty>(
	this HtmlHelper<TModel> htmlHelper,
	Expression<Func<TModel, TProperty>> expression,
	IDictionary<stringobject> htmlAttributes
)

Parameters

htmlHelper
Type: System.Web.Mvc.HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Type: System.Linq.Expressions.Expression<Func<TModelTProperty>>

An expression that identifies the object that contains the properties to render.

htmlAttributes
Type: System.Collections.Generic.IDictionary<StringObject>

A dictionary that contains the HTML attributes to set for the element.

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.

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.

public static MvcHtmlString TextBoxFor<TModel, TProperty>(
	this HtmlHelper<TModel> htmlHelper,
	Expression<Func<TModel, TProperty>> expression,
	object htmlAttributes
)

Parameters

htmlHelper
Type: System.Web.Mvc.HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Type: System.Linq.Expressions.Expression<Func<TModelTProperty>>

An expression that identifies the object that contains the properties to render.

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.

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.

public static MvcHtmlString TextBoxFor<TModel, TProperty>(
	this HtmlHelper<TModel> htmlHelper,
	Expression<Func<TModel, TProperty>> expression,
	string format
)

Parameters

htmlHelper
Type: System.Web.Mvc.HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Type: System.Linq.Expressions.Expression<Func<TModelTProperty>>

An expression that identifies the object that contains the properties to display.

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.

public static MvcHtmlString TextBoxFor<TModel, TProperty>(
	this HtmlHelper<TModel> htmlHelper,
	Expression<Func<TModel, TProperty>> expression,
	string format,
	IDictionary<stringobject> htmlAttributes
)

Parameters

htmlHelper
Type: System.Web.Mvc.HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Type: System.Linq.Expressions.Expression<Func<TModelTProperty>>

An expression that identifies the object that contains the properties to display.

format
Type: System.String

A string that is used to format the input.

htmlAttributes
Type: System.Collections.Generic.IDictionary<StringObject>

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

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

Returns a text input element.

public static MvcHtmlString TextBoxFor<TModel, TProperty>(
	this HtmlHelper<TModel> htmlHelper,
	Expression<Func<TModel, TProperty>> expression,
	string format,
	object htmlAttributes
)

Parameters

htmlHelper
Type: System.Web.Mvc.HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Type: System.Linq.Expressions.Expression<Func<TModelTProperty>>

An expression that identifies the object that contains the properties to display.

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
Show:
© 2015 Microsoft