This documentation is archived and is not being maintained.

ObjectDataSourceDesigner Class

Provides design-time support in a visual designer for the ObjectDataSource Web server control.

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

[SecurityPermissionAttribute(SecurityAction::Demand, Flags = SecurityPermissionFlag::UnmanagedCode)]
public ref class ObjectDataSourceDesigner : public DataSourceDesigner

The ObjectDataSource control represents a data source that calls methods of a business object in order to perform the Delete, Insert, Select, and Update database operations.

In a visual designer, when you switch from Source to Design view, the markup source code that describes the ObjectDataSource control is parsed and a design-time version of the control is created on the design surface. When you switch back to Source view, the design-time control is persisted to the markup source code and edited into the markup for the Web page. The ObjectDataSourceDesigner class provides design-time support for the ObjectDataSource control in a visual designer.

The ObjectDataSourceDesigner class members provide the following functionality:

  • The CanConfigure property indicates whether the Configure Data Source wizard can be displayed. The CanRefreshSchema property indicates whether the schema of the associated ObjectDataSource control can be refreshed at design time.

  • The SelectMethod property specifies the method that performs the Select function. The TypeName property specifies the type of the business object that provides the data for the associated control.

  • The GetView method returns a data source view with the specified name. The GetViewNames method returns a list of data source view names for the associated ObjectDataSource control. The RefreshSchema method extracts the metadata for the Select method from the associated business object.

  • The Configure method causes the Configure Data Source wizard to be displayed on the visual designer surface. The PreFilterProperties method removes properties from, adds additional properties to, or shadows properties of the associated control.

The following code example shows how to extend the ObjectDataSourceDesigner class to change the appearance and behavior of controls that are derived from the ObjectDataSource control at design time.

The example derives the MyObjectDataSource control from the ObjectDataSource. The MyObjectDataSource is a copy of the ObjectDataSource control. The example also derives the MyObjectDataSourceDesigner class from the ObjectDataSourceDesigner and applies a DesignerAttribute attribute for the MyObjectDataSourceDesigner on the MyObjectDataSource control.

The MyObjectDataSourceDesigner overrides the PreFilterProperties method to make the NamingContainer property visible in the Properties grid at design time.

The MyObjectDataSourceDesigner overrides the GetDesignTimeHtml method to display the TypeName and SelectMethod properties in a placeholder, in addition to the control type and ID.

No code example is currently available or this language may not be supported.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: