Registers a name/value pair as a custom (expando) attribute of the specified control given a control ID, an attribute name, an attribute value, and a Boolean value indicating whether to encode the attribute value.
- 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.
- encode
A Boolean value indicating whether to encode the custom attribute to register.
The ClientScriptManager.RegisterExpandoAttribute(string, string, string, bool) 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. Set the encode parameter to true if you need to escape quotes and backslashes in your expando attribute's value.
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.