The wonders of data binding in ASP.NET v2
One of the things that really got me excited about .NET v2 in early 2004 was the more declarative approach to coding ASP.NET pages. I like the idea of having a solid class library and then using as little code as possible in the actual page to get things done. The basic SqlDataSource in combination with various UI controls are great examples, but these barely scratch the surface of the cool things you can do.
The magic really starts with the DataSourceControl and DataSourceView controls. Check out the code samples there. They really show how simple it is to roll this stuff yourself. It frees you of having to mess around with a ton of code and business objects manipulated in page code.
It's not all fun and games all of the time, mind you. It's still not easy to put a DropDownList in a GridView, populate and set its selection, and do it all correctly in the event structure for an edit. In one recent prototype I built, I actually had event handlers output to trace, for rows, the drop downs and the grid itself trying to figure out how to get it all to work. I think I got there, but it wasn't easy.
Doing custom ITemplate controls is a lot of fun too. You know how it is. Repeaters don't do enough, GridViews and DataGrids do too much. But roll your own template-based control, now that's alright! I've got a couple I wrote for the next POP Forums, because I wanted it to be as easy as possible to roll the UI the way it makes the most sense, including the insertion of ads. I'm really pleased with it.
I will post some code, hopefully soon. Crazy busy lately, but will get it up there eventually.