System.Web.UI.ClientScriptManager.RegisterArrayDeclaration Method

Registers a JavaScript array declaration with the System.Web.UI.Page object using an array name and array value.

Syntax

public void RegisterArrayDeclaration (string arrayName, string arrayValue)

Parameters

arrayName
The array name to register.
arrayValue
The array value or values to register.

Remarks

The ClientScriptManager.RegisterArrayDeclaration(string, string) checks to see whether a registered array exists with the same name as the name specified in the arrayName parameter and, if so, adds the values specified in the arrayValue parameter. Because the underlying storage mechanism is based on an ArrayList, duplicates are allowed. If a registered array with the same name as the arrayName parameter does not exist, it is created and the values in the arrayValue parameter added to it.

If you want string literals in the resulting JavaScript array, include single quotation marks (') or escaped double quotation marks (\") in the arrayValue parameter. The value of the arrayValue parameter should be a single element. If more than one value needs to be added to the array, make multiple calls using the ClientScriptManager.RegisterArrayDeclaration(string, string) method.

Requirements

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