May 2009 Entries

ASP.NET: Recursive FindControl & Extension Methods

Here's a really short and simple bit of code that has the potential to be a bit of a time-saver. The FindControl method of the Control class is used to find a specific child control of a given parent, searching by ID. This method, however, doesn't search the control hierarchy recursively: it searches the direct children of the specified parent control only. While writing a recursive version of this method is trivial, a rather nice way to make the method reusable is to implement it as an extension...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

ASP.NET: Simple Calendar & Date Range Selector

I have been playing around with the ASP.NET ListView and Repeater controls quite a bit recently, and thought that a simple calendar control with date range selection capabilities baked-in would make a good example of how these controls can be used to produce some pretty neat functionality without a great deal of code. The System.Web.UI.WebControls namespace already contains a calendar control of course, which is itself quite feature-rich. Although it doesn’t offer support for date range selection...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati