HtmlHelper.TextBox Method (String, Object)
Returns an HTML text control that has the specified name and value.
Namespace: System.Web.WebPages.Html
Assembly: System.Web.WebPages (in System.Web.WebPages.dll)
Syntax
'Declaration
Public Function TextBox ( _
name As String, _
value As Object _
) As IHtmlString
'Usage
Dim instance As HtmlHelper
Dim name As String
Dim value As Object
Dim returnValue As IHtmlString
returnValue = instance.TextBox(name, value)
public IHtmlString TextBox(
string name,
Object value
)
public:
IHtmlString^ TextBox(
String^ name,
Object^ value
)
member TextBox :
name:string *
value:Object -> IHtmlString
public function TextBox(
name : String,
value : Object
) : IHtmlString
Parameters
- name
Type: System.String
The value to assign to the name attribute of the HTML control element.
- value
Type: System.Object
The value to assign to the value attribute of the element.
Return Value
Type: System.Web.IHtmlString
The HTML markup that represents the text control.
Exceptions
Exception | Condition |
---|---|
ArgumentException | name is null reference (Nothing in Visual Basic) or empty. |
Remarks
The returned markup consists of an HTML input element in the following form:
<input type="text" name="name" value="value" />