Export (0) Print
Expand All

ScriptObject.SetProperty Method (Int32, Object)

Silverlight

Sets the value of a property that is identified by ordinal number on the current scriptable object.

Namespace:  System.Windows.Browser
Assembly:  System.Windows.Browser (in System.Windows.Browser.dll)

public void SetProperty(
	int index,
	Object value
)

Parameters

index
Type: System.Int32
The ordinal number of the property.
value
Type: System.Object
The value to set the property to.

ExceptionCondition
ArgumentNullException

index is null.

ArgumentException

index identifies an empty string.

InvalidOperationException

A type mismatch exists between the supplied type and the target property.

-or-

The property is not settable.

-or-

All other failures.

The possible types for value follow the rules for passing managed types to JavaScript using by-reference marshaling rules. For more information, see Returning or Passing Managed Types to JavaScript.

It is possible to set a property value for a non-existing property. In this case, the browser adds the property as an expando on the object.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft