Поделиться через


App Building Notes Day 2

Today I got a lot of work in with the ASP.Net data controls. I haven't really used these much before as I have been working almost solely with ASP.Net MVC for over a year. The three controls I played with were DetailsView, ListView, and FormView. FormView seems to be the equivalent of ListView but for just one item. DetailsView to me just seemed to be a really confusing version of FormView, no idea what to do with all of the different special fields that get generated. FormView is sweet because you can edit the look and feel in design view of Visual Studio, very cool. Why can't I do this with ListView? It seems like this should be do-able.

FormView and ListView make a lot of sense to me because the markup is completely under my control so I understand what is going on. It would be very cool if there was a better way to edit the various templates that get generated. Each of these controls has an itemTemplate, editItemTemplate, alternateItemTemplate, and more. This doesn't seem like good design to me because a lot of the edits I make to itemTemplate will also be made to all the other templates. It looks to be common practice even to just comment out or delete the other templates. Instead, it would be cool if there was a master template and then for my alternateItemTemplate I could just inherit all of these fields but change my css, or for the edit template, make certain fields editable. This would be much more practical and readable.

One other feature I was thinking about is a way to ensure style ends up in my site's css file. If I resize a button, maybe I could get an option to create a new style that is named buttonStyle, with the proper size attributes. The button's class attribute could then get set to this new style. What do you think?