Programming with Data Controls in ASP.NET (Part 2)

Improved Data Source caching:

  • Exposed via properties on datasource controls (EnableCaching="True", CacheDuration="5", etc.). Greatly simplifies the use of caching with data, as simple or simpler than output caching.
  • Added SQL Cache Invalidation - automatically purges cached output or data when the underlying data is changed. Again, this is exposed via properties on the datasource controls (can be configured in the @ Page directive of ASP.NET pages as well).
  • Caching also allows you to pull more data, and use the filtering functionality of the datasource controls to view subsets of data, without incurring the expense of pulling the data from the database on each request.
  • New configuration section in web.config for Connection Strings. MMC Snap-in for configuring ASP.NET allows GUI access to this config section, and you can also access them via the configuration API. In declarative code, it uses a

       <%$ connectionname:tablename %>

    syntax for accessing a given connection.
  • New DetailsView control, provides a more intuitive way of providing the details portion of a master-detail relationship, with the GridView control handling the master portion of the relationship. DetailsView provides an easy UI for inserting/updating data.
  • Added new syntax for databinding in templates:

    <%# Eval("field") %> 'for one-way binding

    <%# Bind("field") %> 'for two-way binding


  • Both GridView and DetailsView support two-way databinding (this feature is not in the PDC build of Whidbey).
  • Templated databinding supports drag and drop of controls to be databound within, for example, a DetailsView control that is in template editing mode.
  • New hierarchical DataSource controls - provide access to XML files and ASP.NET site maps, for example, and integrate with new controls designed to render hierarchical data, such as the TreeView control.
  • All templated controls now also support databinding to XML, using XPath databinding expressions.

No Comments