HtmlHelper.TextBox 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
TextBox(String, Object, IDictionary<String,Object>) |
Returns an HTML text control that has the specified name, value, and custom attributes defined by an attribute dictionary. |
TextBox(String) |
Returns an HTML text control that has the specified name. |
TextBox(String, Object) |
Returns an HTML text control that has the specified name and value. |
TextBox(String, Object, Object) |
Returns an HTML text control that has the specified name, value, and custom attributes defined by an attribute object. |
TextBox(String, Object, IDictionary<String,Object>)
Returns an HTML text control that has the specified name, value, and custom attributes defined by an attribute dictionary.
public System.Web.IHtmlString TextBox(string name, object value, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
member this.TextBox : string * obj * System.Collections.Generic.IDictionary<string, obj> -> System.Web.IHtmlString
Public Function TextBox (name As String, value As Object, htmlAttributes As IDictionary(Of String, Object)) As IHtmlString
Parameters
- name
- String
The value to assign to the name attribute of the HTML control element.
- value
- Object
The value to assign to the value attribute of the element.
- htmlAttributes
- IDictionary<String,Object>
The names and values of custom attributes for the element.
Returns
The HTML markup that represents the text control.
Exceptions
name
is null or empty.
Applies to
TextBox(String)
Returns an HTML text control that has the specified name.
public System.Web.IHtmlString TextBox(string name);
member this.TextBox : string -> System.Web.IHtmlString
Public Function TextBox (name As String) As IHtmlString
Parameters
- name
- String
The value to assign to the name attribute of the HTML control element.
Returns
The HTML markup that represents the text control.
Exceptions
name
is null or empty.
Applies to
TextBox(String, Object)
Returns an HTML text control that has the specified name and value.
public System.Web.IHtmlString TextBox(string name, object value);
member this.TextBox : string * obj -> System.Web.IHtmlString
Public Function TextBox (name As String, value As Object) As IHtmlString
Parameters
- name
- String
The value to assign to the name attribute of the HTML control element.
- value
- Object
The value to assign to the value attribute of the element.
Returns
The HTML markup that represents the text control.
Exceptions
name
is null or empty.
Applies to
TextBox(String, Object, Object)
Returns an HTML text control that has the specified name, value, and custom attributes defined by an attribute object.
public System.Web.IHtmlString TextBox(string name, object value, object htmlAttributes);
member this.TextBox : string * obj * obj -> System.Web.IHtmlString
Public Function TextBox (name As String, value As Object, htmlAttributes As Object) As IHtmlString
Parameters
- name
- String
The value to assign to the name attribute of the HTML control element.
- value
- Object
The value to assign to the value attribute of the element.
- htmlAttributes
- Object
An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object.
Returns
The HTML markup that represents the text control.
Exceptions
name
is null or empty.