Export (0) Print
Expand All

ScriptManager.RegisterArrayDeclaration Method (Page, String, String)

Registers an ECMAScript (JavaScript) array declaration with the ScriptManager control for use with a control that is inside an UpdatePanel control, and adds the array to the page.

Namespace:  System.Web.UI
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

'Declaration
Public Shared Sub RegisterArrayDeclaration ( _
	page As Page, _
	arrayName As String, _
	arrayValue As String _
)

Parameters

page
Type: System.Web.UI.Page

The page object that is registering the array.

arrayName
Type: System.String

The name of the array to register.

arrayValue
Type: System.String

The array value or values to register.

ExceptionCondition
ArgumentNullException

arrayName is Nothing.

You use the RegisterArrayDeclaration method to register a client script array that is compatible with partial-page rendering and that has no Microsoft Ajax Library dependencies. This method registers the array every time that an asynchronous postback occurs. To register an array for a control that is inside an UpdatePanel control so that the array is registered only when the panel is updated, use the RegisterArrayDeclaration(Control, String, String) overload of this method. 

If you want to register an array that does not pertain to partial-page updates, and if you want to register the array only one time during initial page rendering, use the RegisterArrayDeclaration method of the ClientScriptManager class. You can get a reference to the ClientScriptManager object from the ClientScript property of the page.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5

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.

Show:
© 2014 Microsoft