Dela via


HtmlHelperInputExtensions.TextBox Method

Definition

Overloads

TextBox(IHtmlHelper, String)

Returns an <input> element of type "text" for the specified expression. Adds a "value" attribute to the element containing the first non-null value found in: the ModelState entry with full name, the ViewData entry with full name, or the expression evaluated against Model. See Name(String) for more information about a "full name".

TextBox(IHtmlHelper, String, Object)

Returns an <input> element of type "text" for the specified expression. Adds a "value" attribute to the element containing the first non-null value found in: the ModelState entry with full name, the value parameter, the ViewData entry with full name, or the expression evaluated against Model. See Name(String) for more information about a "full name".

TextBox(IHtmlHelper, String, Object, Object)

Returns an <input> element of type "text" for the specified expression. Adds a "value" attribute to the element containing the first non-null value found in: the ModelState entry with full name, the value parameter, the ViewData entry with full name, the expression evaluated against Model, or the htmlAttributes dictionary entry with key "value". See Name(String) for more information about a "full name".

TextBox(IHtmlHelper, String, Object, String)

Returns an <input> element of type "text" for the specified expression. Adds a "value" attribute to the element containing the first non-null value found in: the ModelState entry with full name, the value parameter, the ViewData entry with full name, or the expression evaluated against Model. See Name(String) for more information about a "full name".

TextBox(IHtmlHelper, String)

Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs

Returns an <input> element of type "text" for the specified expression. Adds a "value" attribute to the element containing the first non-null value found in: the ModelState entry with full name, the ViewData entry with full name, or the expression evaluated against Model. See Name(String) for more information about a "full name".

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Html::IHtmlContent ^ TextBox(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, System::String ^ expression);
public static Microsoft.AspNetCore.Html.IHtmlContent TextBox (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string expression);
static member TextBox : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function TextBox (htmlHelper As IHtmlHelper, expression As String) As IHtmlContent

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

expression
String

Expression name, relative to the current model.

Returns

A new IHtmlContent containing the <input> element.

Remarks

Combines HtmlFieldPrefix and expression to set <input> element's "name" attribute. Sanitizes expression to set element's "id" attribute.

Applies to

TextBox(IHtmlHelper, String, Object)

Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs

Returns an <input> element of type "text" for the specified expression. Adds a "value" attribute to the element containing the first non-null value found in: the ModelState entry with full name, the value parameter, the ViewData entry with full name, or the expression evaluated against Model. See Name(String) for more information about a "full name".

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Html::IHtmlContent ^ TextBox(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, System::String ^ expression, System::Object ^ value);
public static Microsoft.AspNetCore.Html.IHtmlContent TextBox (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string expression, object value);
static member TextBox : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string * obj -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function TextBox (htmlHelper As IHtmlHelper, expression As String, value As Object) As IHtmlContent

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

expression
String

Expression name, relative to the current model.

value
Object

If non-null, value to include in the element.

Returns

A new IHtmlContent containing the <input> element.

Remarks

Combines HtmlFieldPrefix and expression to set <input> element's "name" attribute. Sanitizes expression to set element's "id" attribute.

Applies to

TextBox(IHtmlHelper, String, Object, Object)

Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs

Returns an <input> element of type "text" for the specified expression. Adds a "value" attribute to the element containing the first non-null value found in: the ModelState entry with full name, the value parameter, the ViewData entry with full name, the expression evaluated against Model, or the htmlAttributes dictionary entry with key "value". See Name(String) for more information about a "full name".

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Html::IHtmlContent ^ TextBox(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, System::String ^ expression, System::Object ^ value, System::Object ^ htmlAttributes);
public static Microsoft.AspNetCore.Html.IHtmlContent TextBox (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string expression, object value, object htmlAttributes);
static member TextBox : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string * obj * obj -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function TextBox (htmlHelper As IHtmlHelper, expression As String, value As Object, htmlAttributes As Object) As IHtmlContent

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

expression
String

Expression name, relative to the current model.

value
Object

If non-null, value to include in the element.

htmlAttributes
Object

An Object that contains the HTML attributes for the element. Alternatively, an IDictionary<TKey,TValue> instance containing the HTML attributes.

Returns

A new IHtmlContent containing the <input> element.

Remarks

Combines HtmlFieldPrefix and expression to set <input> element's "name" attribute. Sanitizes expression to set element's "id" attribute.

Applies to

TextBox(IHtmlHelper, String, Object, String)

Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs

Returns an <input> element of type "text" for the specified expression. Adds a "value" attribute to the element containing the first non-null value found in: the ModelState entry with full name, the value parameter, the ViewData entry with full name, or the expression evaluated against Model. See Name(String) for more information about a "full name".

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Html::IHtmlContent ^ TextBox(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, System::String ^ expression, System::Object ^ value, System::String ^ format);
public static Microsoft.AspNetCore.Html.IHtmlContent TextBox (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string expression, object value, string format);
static member TextBox : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string * obj * string -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function TextBox (htmlHelper As IHtmlHelper, expression As String, value As Object, format As String) As IHtmlContent

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

expression
String

Expression name, relative to the current model.

value
Object

If non-null, value to include in the element.

format
String

The format string (see https://msdn.microsoft.com/en-us/library/txafckwd.aspx) used to format the "value" attribute unless that came from model binding.

Returns

A new IHtmlContent containing the <input> element.

Remarks

Combines HtmlFieldPrefix and expression to set <input> element's "name" attribute. Sanitizes expression to set element's "id" attribute.

Applies to