System.Web.UI.DataBinder.GetDataItem Method

Retrieves an object's declared data item.

Syntax

public static object GetDataItem (object container)

Parameters

container
The object reference against which the expression is evaluated. This must be a valid object identifier in the page's specified language.

Returns

An object that represents the container's declared data item. Returns null if no data item is found or if the container evaluates to null.

Remarks

This method calls the DataBinder.GetDataItem(object, Boolean@) method, ignoring its foundDataItem parameter when returning the result.

An object's data item is identified in one of two ways. If the container object implements the System.Web.UI.IDataItemContainer interface, the IDataItemContainer.DataItem property identifies the data item, and its value is returned. Otherwise, the method attempts to resolve and return a container property named "DataItem".

Requirements

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