Building your own Data Source Controls in ASP.NET 2.0

ASP.NET 2.0 introduces a powerful new declarative data-source model.  Among other things, it makes doing data access much easier in a stateless-web world -- and eliminates many of the hurdles developers have to jump through today to handle repeated data UI operations on the server.  Included in the box is the new ObjectDataSource control, which you can use to databind to any .NET class -- no special databinding interfaces are required, and it enables pretty easy three-tier databinding scenarios.

Nikhil wrote a great 5-part article series on MSDN recently that walksthrough how to build you own reusable data-source controls (for example: if you use a specific O/R mapping layer, you might want to build a datasource control to directly integrate with it).

Here are links to the five articles to check-out:

Hope this helps,

Scott

2 Comments

  • Thanks for the articles. They helped me to write my own Custom Data Source. However it's not clear to me how to register my data source on the page. How can I give it a prefix like it's shown in the example?



    Thanks!

  • Hi HowTo,

    Once you've built your control, you should register is on the page like a normal ASP.NET server control (using a directive or adding it into a web.config file).

    Hope this helps,

    Scott

Comments have been disabled for this content.