CSLADataSource - databinding

CSLADataSource - databinding

Old forum URL: forums.lhotka.net/forums/t/126.aspx


mgonzales3 posted on Wednesday, May 17, 2006

This is a very basic question.  Using an asp.net 2.0 app, Is using the csladatasource the recommended method form of databinding?  I guess we should not directly bind the gridviews, listboxes, etc... ?

Thanks

 

razorkai replied on Wednesday, May 17, 2006

Quote from the book:-

"Unfortunately, the data source controls provided with ASP.NET are not designed to work with objects that contain business logic—meaning that they aren’t useful when working with CSLA .NET business objects. To overcome this limitation, the CslaDataSource control is an ASP.NET data source control that is designed to work with objects containing business logic. This control allows the full use of Web Forms data binding with rich business objects."

HTH

John

mgonzales3 replied on Wednesday, May 17, 2006

John,

Using 1.5x (when i was introduced to csla) we binded datagrids, ddl, listboxes, etc... like so:

Private Sub FetchJurorLightColFromDatabase()
        mMyCol = ColObj.SearchStuff(mSearchCriteria)
        MarkSelected()
        BindGrid()
End Sub

Private Sub BindGrid()
        Sort()
        dgGrid.DataSource = mMyCol
        dgGrid.DataBind()
End Sub

razorkai replied on Thursday, May 18, 2006

Mike

But this is Asp.Net 2 and things have apparently changed.  Can't say much more myself as I don't use it much.  Just assume that for whatever reason you should use the CslaDatasource.

Copyright (c) Marimer LLC