Adding a CSS class declaritively

Jul 20, 2009 at 3:36 PM
Edited Jul 20, 2009 at 3:37 PM

Hi all,

Really enjoying using these adapters - I'm very pleased that my .NET web apps are finally outputting good standards HTML!

I notice that with the FormViewAdapter, if I decalaritively add a CSS class using the CssClass property, the class doesn't get rendered. I've notice in the source for the FormViewAdapter that the classes are hard coded into the outputted HTML.

2 questions: first of all, what is the reasoning behind these class names? How are they supposed to be helpful to us? I'm genuinely interested, as it's not immediately apparent to me why they've been named this way e.g. "AspNet-FormView", "AspNet-FormViewData" etc - seems like logical naming, but personally I would like to add my own classname to the outer div of the formview for extra control.

2nd question - how do I append the base WebControl property "CssClass" to the html that gets rendered? e.g. "AspNet-FormView myClass" I can't seem to get access to the CssClass property from the FormViewAdapter class.