Export (0) Print
Expand All

TemplateContainerAttribute::BindingDirection Property

Gets the binding direction of the container control.

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

public:
property BindingDirection BindingDirection {
	BindingDirection get ();
}

Property Value

Type: System.ComponentModel::BindingDirection
A BindingDirection indicating the container control's binding direction. The default is OneWay.

The BindingDirection property can be either the OneWay field, where the template can accept only property values or the TwoWay field, where the template can accept and expose property values. In the latter scenario, data-bound controls automatically can use the update, delete, and insert operations of a data source using the Bind data-binding syntax.

For more information on data binding, see Binding to Databases and Data-Binding Expressions Overview.

The following code example demonstrates how to create a templated control named TemplatedFirstControl and associate it with a container named FirstTemplateContainer. This allows the creation of custom controls that display the server time when the template is not specified and the contents of the template when the template is specified. The GetCustomAttribute method determines the BindingDirection property of the FirstTemplate property of the TemplateFirstControl.

This code example is part of a larger example provided for the TemplateContainerAttribute class.

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

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft