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

ClientScriptManager.RegisterExpandoAttribute Method (String, String, String)

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

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)
public void RegisterExpandoAttribute(
	string controlId,
	string attributeName,
	string attributeValue


Type: System.String

The Control on the page that contains the custom attribute.

Type: System.String

The name of the custom attribute to register.

Type: System.String

The value of the custom attribute.

The RegisterExpandoAttribute method registers a name/value pair as a custom (expando) attribute on the specified 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 RegisterExpandoAttribute 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.

.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
© 2014 Microsoft. All rights reserved.