Duration (Pacific Standard Time):
To (Pacific Standard Time):
Impact:
User Action:

DynamicDataExtensions.FindDataSourceControl Method (Control)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns the data source that is associated with the data control for the specified control.

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

<ExtensionAttribute>
Public Shared Function FindDataSourceControl (
	current As Control
) As IDynamicDataSource

Parameters

current
Type: System.Web.UI.Control

A control inside the hierarchy of a data-bound control whose containing control you want to find.

Return Value

Type: System.Web.DynamicData.IDynamicDataSource

The data source that is associated with the data control for the specified control.

The following example shows how to find the containing data source control. In the example, the Dynamic Data page templates are copied to the \DynamicData\CustomPages\ProductDescriptions folder to provide a custom display for the ProductDescription table of the AdventureWorksLT database. The Insert.aspx file markup is changed to add an OnDataBound event handler named DetailsView1_DataBound, in which the FindDataSourceControl method is called to find the data source control.

No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
.NET Framework
Available since 3.5
Return to top