November 2007 Blog Posts

Getting the GridView Row Number for Custom Commands

This stemmed from a question on a mailing list and I had most of the answer, but have now discovered something that's now new, but is new to me. When using a GridView you often have command buttons that perform some command on the row. Not the selected row, because selection is something different. generally I do this by giving my buttons a CommandName and handling the RowCommand event of the grid. The problem has been how do I get the row number and also the key value for that item in the row. If you use a...

posted @ Thursday, November 22, 2007 10:56 AM | Feedback (1)

In Search of Carbon Worth

The old paper v. e-book debate has started again, with the release of several new e-book readers. The publishing industry has been playing with this for years, but it's only now that the technology is making it viable. I don't deny there are some great benefits from them, but I'm not convinced they outweigh the downsides. Here's my view and yes, from my point of view there are only two good points: Pros Density: you can carry multiple books. Searchability: useful for reference books. Cons Battery life: I've yet to have a book not work because of battery...

posted @ Tuesday, November 20, 2007 11:39 PM | Feedback (0)

FormView ModeChanged Event

Something I've just discovered upon using the FormView is that the ModeChanged event is not useful for accessing the controls within the template of the new mode. It seems the obvious event, but it's really only a notification that the CurrentMode has changed; the control collection is still under construction, so the controls of the new template aren't available. Any controls you do access (using FindControl of course) will be from the template of the previous mode, not the template of the new mode. To access the controls in the current template, when the template has changed, you should use...

posted @ Wednesday, November 14, 2007 5:23 PM | Feedback (0)

Ajax Web Parts

I like Web Parts, really I do. Their functionality is great, but I find them a bit heavy; the HTML they generate isn't great and some of the customisation is dated now that Ajax is popular. In fact, I can't help feeling that if the ASP.NET team had to write Web Parts from scratch now, they certainly wouldn't take the same route; they'd be Ajax based all of the way. There were many ways in which I could have improved the existing functionality of Web Parts, but it just didn't seem sensible given that the things I don't like about them are inherent...

posted @ Monday, November 12, 2007 1:09 PM | Feedback (1)