This documentation is archived and is not being maintained.

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
)
public static Object GetDataItem (
	Object container
)
public static function GetDataItem (
	container : Object
) : Object
Not applicable.

Parameters

container

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

Return Value

An object that represents the container's declared data item. Returns a null reference (Nothing in Visual Basic) if no data item is found or if the container evaluates to a null reference (Nothing in Visual Basic).

This method calls the GetDataItem 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".

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Show: