This is an unfocused post on my last couple of days putting together a datalist with oncommand events.
Do people use these a lot? There are very cool capabilities in using OnEditCommand, OnUpdateCommand, OnSelectCommand, and OnCancelCommand. There seems an art to using OnItemDataBound method correctly, covering each ItemListType within it. Doesn't seem a very--I don't know--elegant space?
In a template, just using Command=”Edit” or “Cancel” or “Update” or “Select” or “Delete” in the .ASPX always intrigued me that ASP.NET knows they handle their respective event.
I last built a datalist with the OnCommand events over two years ago. I'm not sure how to explain that its been two years since I found a use for an application like this. But I don't think my web apps suffered as a result.
Using a datalist (or other BaseDataList)'s OnCommand set of methods is like being pregnant, as they say. You can't be a little bit pregnant. You throw in an OnCancelCommand you're finding yourself using the whole suite. Edit, Select and Update, for sure. Delete optional...
Another of those “won't have to do this in Winforms” thoughts. Is this making ASP.NET doing something a browser was never intended to do? Feels that way. Kinda kludgy or kinda brilliant? I don't know.
The SmartNavigation=”True” page directive setting is golden for long lists. Very sweet. Slows things down, but its great to arrive at the entry you left.
Viewstate and postback are so seemingly problematic and weird with OnCommand events. Or maybe its my lack of in-depth understanding in this area.
The VS.NET sample in ms-help uses session to pass a dataview. Just felt that it was interesting.
When it comes to using OnEditCommand and so forth, I don't know what to think...