DataBinder.GetIndexedPropertyValue Method (Object, String)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Retrieves the value of a property of the specified container and navigation path.

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

public static object GetIndexedPropertyValue(
	object container,
	string expr


Type: System.Object

The object reference against which expr is evaluated. This must be a valid object identifier in the specified language for the page.

Type: System.String

The navigation path from the container object to the public property value to place in the bound control property. This must be a string of property or field names separated by periods, such as Tables[0].DefaultView.[0].Price in C# or Tables(0).DefaultView.(0).Price in Visual Basic.

Return Value

Type: System.Object

An object that results from the evaluation of the data-binding expression.

Exception Condition

container is null.

- or -

expr is null or an empty string ("").


expr is not a valid indexed expression.

- or -

expr does not allow indexed access.

The value of expr must evaluate to a public property.

For any of the list Web controls, such as GridView, DetailsView, DataList, or Repeater, container should be Container.DataItem. If you are binding against the page, container should be Page.

.NET Framework
Available since 1.1
Return to top