DataBinder.GetDataItem Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves an object's declared data item.
GetDataItem(Object) |
Retrieves an object's declared data item. |
GetDataItem(Object, Boolean) |
Retrieves an object's declared data item, indicating success or failure. |
Retrieves an object's declared data item.
public:
static System::Object ^ GetDataItem(System::Object ^ container);
public static object GetDataItem (object container);
static member GetDataItem : obj -> obj
Public Shared Function GetDataItem (container As Object) As Object
Parameters
- container
- Object
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 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".
See also
Applies to
.NET Framework 4.8.1 and other versions
Product | Versions |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Retrieves an object's declared data item, indicating success or failure.
public:
static System::Object ^ GetDataItem(System::Object ^ container, [Runtime::InteropServices::Out] bool % foundDataItem);
public static object GetDataItem (object container, out bool foundDataItem);
static member GetDataItem : obj * bool -> obj
Public Shared Function GetDataItem (container As Object, ByRef foundDataItem As Boolean) As Object
Parameters
- container
- Object
The object reference against which the expression is evaluated. This must be a valid object identifier in the page's specified language.
- foundDataItem
- Boolean
A Boolean value that indicates whether the data item was successfully resolved and returned. This parameter is passed uninitialized.
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
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".
See also
Applies to
.NET Framework 4.8.1 and other versions
Product | Versions |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: