Export (0) Print
Expand All

DataBinder.GetDataItem Method (Object)

Retrieves an object's declared data item.

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

public static Object GetDataItem(
	Object container
)

Parameters

container
Type: System.Object

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

Return Value

Type: System.Object
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.

This method calls the 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 IDataItemContainer interface, the DataItem property identifies the data item, and its value is returned. Otherwise, the method attempts to resolve and return a container property named "DataItem".

.NET Framework

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

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