I don’t use many (actually, I try not to use any) of the built-in styling properties of ASP.NET server controls.  The only property that means a thing to me is CssClass.  However, there are a few properties I find I always have to set to avoid crummy markup.  Chief amongst these is the GridView’s GridLines property – if you don’t set this to ‘None’ and CellSpacing to -1, CSS styling of grid borders isn’t possible as inline styles will override any of your stylings.

I don’t really theme sites either, largely because of the aforementioned bad markup – the presentational properties result in a slew of inline styles applied to many elements which bloats the HTML. Since I’m not using them for anything else, a single ‘Default’ theme’s skin files actually works very well as “policy” style document.  I always set these two properties on any GridView - now I can set them once in a ‘Default’ theme and every GridView I use will inherit the policy. Not precisely what themes were intended for, but pretty useful nonetheless (at least until ASP.NET Control Adapters arrive later this month) :)

ScaffoldingCode generation is everywhere these days, from the basic (but getting steadily more complex) Visual Studio IDE generations to full model- and template-based systems (like my preferred option, DeKlarit). Over the years, various methods have evolved to stop code you hand-modified getting overwritten when the code generation runs. These range from comments in the source file warning you not to change anything on pain of overwriting to more complex solutions where you can mark sections of your own code untouchable.

In this post I’m going to explore a way of giving at least some of the same functionality Rails has to ASP.NET 2.0.
Continue reading »

There’s no doubt ASP.NET 2.0 Themes look like a compelling way of skinning your web app at first glance. Look a little deeper, though, and it seems that Themes could easily seduce you into using MS-only ASP.NET property attributes instead of thinking about your markup tree semantically Continue reading »

© 2014 ZephyrBlog Suffusion theme by Sayontan Sinha