ObjectDataSourceDesigner Class
Assembly: System.Design (in system.design.dll)
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.
- SecurityPermission for permission to call unmanaged code when using the ContentDesigner. Demand value: Demand. Permission value: UnmanagedCode
System.ComponentModel.Design.ComponentDesigner
System.Web.UI.Design.HtmlControlDesigner
System.Web.UI.Design.ControlDesigner
System.Web.UI.Design.DataSourceDesigner
System.Web.UI.Design.WebControls.ObjectDataSourceDesigner
Reference
ObjectDataSourceDesigner MembersSystem.Web.UI.Design.WebControls Namespace
ObjectDataSource
DataSourceControl
DataSourceDesigner
ControlDesigner
HtmlControlDesigner
ComponentDesigner
Other Resources
Introduction to ASP.NET Control DesignersWalkthrough: Creating a Basic Control Designer for a Web Server Control