Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

DataBinder.GetDataItem Method (Object, Boolean)

Retrieves an object's declared data item, indicating success or failure.

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

public static Object GetDataItem(
	Object container,
	out bool foundDataItem


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.

Type: System.Boolean

A Boolean value that indicates whether the data item was successfully resolved and returned. This parameter is passed uninitialized.

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.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
© 2015 Microsoft