HtmlHelper.Label Method (String)

Returns an HTML label that displays the specified text.

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

Syntax

'Declaration
Public Function Label ( _
    labelText As String _
) As IHtmlString
'Usage
Dim instance As HtmlHelper 
Dim labelText As String 
Dim returnValue As IHtmlString 

returnValue = instance.Label(labelText)
public IHtmlString Label(
    string labelText
)
public:
IHtmlString^ Label(
    String^ labelText
)
member Label : 
        labelText:string -> IHtmlString
public function Label(
    labelText : String
) : IHtmlString

Parameters

Return Value

Type: System.Web.IHtmlString
The HTML markup that represents the label.

Exceptions

Exception Condition
ArgumentException

labelText is null reference (Nothing in Visual Basic) or empty.

Remarks

The returned markup consists of an HTML label element in the following form:

<label for="labelText">labelText</label>

See Also

Reference

HtmlHelper Class

Label Overload

System.Web.WebPages.Html Namespace