System.Web.UI.ClientScriptManager.RegisterExpandoAttribute Method

Registers a name/value pair as a custom (expando) attribute of the specified control given a control ID, attribute name, and attribute value.

Syntax

public void RegisterExpandoAttribute (string controlId, string attributeName, string attributeValue)

Parameters

controlId
The System.Web.UI.Control on the page that contains the custom attribute.
attributeName
The name of the custom attribute to register.
attributeValue
The value of the custom attribute.

Remarks

The ClientScriptManager.RegisterExpandoAttribute(string, string, string) method registers a name/value pair as a custom (expando) attribute on the specified System.Web.UI.Control. The expando attribute is set dynamically from JavaScript to preserve XHTML compatibility for the rendered control's markup. Quotes and backslashes in the custom (expando) attribute's values are escaped. If you do not want to escape quotes and backslashes, call the ClientScriptManager.RegisterExpandoAttribute(string, string, string, bool) overload method and set the encode parameter to false.

If the expando attribute is not found or the control to add the expando attribute to is not found, the client script is still emitted, but it will not affect the control.

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0