Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

HtmlForm::UniqueID Property

Gets the unique programmatic identifier assigned to the HtmlForm control.

Namespace:  System.Web.UI.HtmlControls
Assembly:  System.Web (in System.Web.dll)
public:
virtual property String^ UniqueID {
	String^ get () override;
}

Property Value

Type: System::String
The unique programmatic identifier assigned to the HtmlForm control.

Use the UniqueID property to get the unique programmatic identifier assigned to the HtmlForm control. This property overrides the base implementation to return a constant value when the control is contained in an INamingContainer-implemented object other than a page, such as a custom server control. If the naming container is a page, the value of the HtmlForm control's ID property is returned.

The UniqueID property and the Name property always return the same value. This is useful when the HtmlForm control is rendered on a browser that requires the HtmlForm control's UniqueID and Name properties to be the same. To keep these properties synchronized, the Name property always returns the value of the UniqueID property.

NoteNote

The name attribute is not an XHTML-compliant attribute and by default is not rendered by ASP.NET.

The following code example demonstrates how to use the UniqueID property to retrieve the unique identifier for an HtmlForm control.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.