Rules and Limitations of the Databinding controls

  • Controls are based on the Web Form as a parent
    All binding occurs against objects of the current Web form as the base. So you can reference an Item business object on the page as "this.Item.Entity" or "Item.Entity". You can also bind DataRows as long as they are somehow referenced through the page: "this.Item.DataRow" or "this.DataRow". You can use either this. or me. as a prefix for the form.

  • Binding only works against public and protected members
    The DataBinder operates using Reflection to retrieve and set binding values, and so it can only work against public or protected members of objects. It's best to use public scope for anything you are binding to as this will work regardless of ASP.NET Trust settings. In Medium trust or lower protected mode Reflection is not allowed, so public scope is recommended. Objects that are marked as private will not be bindable and result in a binding error.

  • Usage of this and me
    As mentioned above you should not don't need to use use this or me (in VB) in the BindingSource, but you can optionally. These are decorator properties only and so aren't required as the base is always the current form instance. In some instances however, you have to use this or me: If you are binding a Page property directly you have to use this as the prefix. For example, you can bind this.Title to bind the page titlebar text:

    <ww:DataBindingItem BindingSource="this" BingingSourceMember="Title" />



© West Wind Technologies, 1996-2016 • Updated: 11/26/09
Comment or report problem with topic