Click or drag to resize
FormExtensionsLabel Method
Returns an HTML label element for given formComponent.

Namespace: Kentico.Forms.Web.Mvc
Assembly: Kentico.Content.Web.Mvc (in Kentico.Content.Web.Mvc.dll) Version: 13.0.131
Syntax
C#
public static IHtmlContentProxy Label(
	this HtmlHelperExtensionPoint htmlHelper,
	FormComponent formComponent,
	IDictionary<string, Object> htmlAttributes = null,
	bool renderColon = true
)

Parameters

htmlHelper
Type: Kentico.Web.MvcHtmlHelperExtensionPoint
HtmlHelper extension.
formComponent
Type: Kentico.Forms.Web.MvcFormComponent
The form component to render the label for.
htmlAttributes (Optional)
Type: System.Collections.GenericIDictionaryString, Object
An object containing additional HTML attributes for the label.
renderColon (Optional)
Type: SystemBoolean
Indicates whether a colon is to be rendered after the label text. If a label text is missing then colon is not rendered.

Return Value

Type: IHtmlContentProxy
An HTML label element for form component.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HtmlHelperExtensionPoint. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown when htmlHelper or formComponent is null.
ArgumentExceptionThrown when Name of the form component passed is null or an empty string.
See Also