DataBinding Class
Contains information about a single data-binding expression in an ASP.NET server control, which allows rapid-application development (RAD) designers, such as Microsoft Visual Studio, to create data-binding expressions at design time. This class cannot be inherited.
Assembly: System.Web (in System.Web.dll)
The DataBinding type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Expression | Gets or sets the data-binding expression to be evaluated. |
![]() | PropertyName | Gets the name of the ASP.NET server control property to bind data to. |
![]() | PropertyType | Gets the .NET Framework type of the data-bound ASP.NET server control property. |
| Name | Description | |
|---|---|---|
![]() | Equals | Determines whether the specified object is the same instance of the DataBinding class as the current object. (Overrides Object::Equals(Object).) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Retrieves the hash code for an instance of the DataBinding object. (Overrides Object::GetHashCode().) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
Each data-binding expression in a server control is represented at design time by an instance of the DataBinding class. Any server control that contains one or more data-binding expressions has a DataBindingCollection object that contains the DataBinding objects. This collection is accessible through the Control class implementing the IDataBindingsAccessor interface. When you create a custom RAD designer, use that implementation to access the collection. Any DataBinding or DataBindingCollection objects associated with a server control exist only at design time. They do not exist at run time and, therefore, are not accessible during run time.
The following code example creates a DataBinding object and sets it equal to an existing object in the control's DataBindingCollection collection that has a propertyName parameter with a value of Text. If the collection contains a DataBinding object with a propertyName value of Text, this code returns the value of the object's Expression property. If there is no such object, it returns an empty string ("").
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.


