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

ScriptManager.RegisterExpandoAttribute Method

Registers a name/value pair with the ScriptManager control as a custom (expando) attribute of a specified control.

Namespace:  System.Web.UI
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)
public static void RegisterExpandoAttribute(
	Control control,
	string controlId,
	string attributeName,
	string attributeValue,
	bool encode
)

Parameters

control
Type: System.Web.UI.Control
The control that is registering the expando attribute.
controlId
Type: System.String
The control that contains the custom attribute on the page.
attributeName
Type: System.String
The name of the custom attribute to register.
attributeValue
Type: System.String
The value of the custom attribute.
encode
Type: System.Boolean
true to encode the custom attribute that is being registered; otherwise, false.
ExceptionCondition
ArgumentNullException

control is null.

ArgumentException

control is not in the page's control tree.

- or -

controlId is null.

- or -

controlId is empty.

- or -

attributeName is null.

- or -

attributeName is empty.

- or -

attributeName is already registered.

You use the RegisterExpandoAttribute method to register a custom (expando) property for a control that is compatible with partial-page rendering and that has no Microsoft Ajax Library dependencies.

The RegisterExpandoAttribute method registers a name/value pair as a custom attribute for the specified control. The property is set dynamically from ECMAScript (JavaScript) to preserve XHTML compatibility for the rendered control's markup. Set encode to true if you have to escape any characters in the dynamic property's value.

If the control to which the dynamic property will be added is not found, a script error occurs.

.NET Framework

Supported in: 4, 3.5

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.