tags:

views:

183

answers:

7

I'm working on a project that uses Asp.Net themes and don't see their purpose.

The users can't change the theme on the fly, the site(s) already use masterpages and css.

Does anybody have any theme specific functionality they've found useful or helpful that css couldn't do on its own?

Please note that I have indeed thrown .css files through Isapi and done some dynamic styling just fine without asp.net themes.

A: 

None.

ASP.NET themes are built into the framework and make it easier to switch by setting a framework variable. However I favor .css which is easy to implement if done correctly.

David Basarab
+3  A: 

ASP.NET themes and CSS are two roads that lead to the same city. In my experience there is not much you can do with one that you cannot do with the other. In my experience I have also found that CSS tends to be the best approach in terms of scalability and maintainability.

Andrew Hare
Yikes, two downvotes and no reasons! If you don't agree please provide a rationale so that a discussion can take place.
Andrew Hare
No down vote from me but see my answer below. I think this question is not a fair comparison. You can (and should) use CSS with themes.
Adam Carr
I downvoted you, because you didn't mention the difference that App Themes let you configure server-side properties of controls. I didn't mention it because it's in my post below :) I also downvoted because using App Themes doesn't mean that you don't use CSS; they work together quite happily. What you're referring to is inline styling of the controls, which, app themes or not, is generally bad.
Noon Silk
I downvoted because four upvotes for an answer that doesn't take into account any of the points in the other answers seems way to high and because of what @silky said.
David McEwing
A: 

From my experience, themes are pretty useless except to bloat the HTML with lots of redundant styling.

Jerry Bullard
A: 

Yes.

asp.net 'themes' let you not alone set css and images for whatever theme is selected, you can use a .Skin file to change any '[Themeable]' property of a .net control. This is not possible in css alone (as it's a server-side thing).

Noon Silk
Can't we just use css classes to get the same effect?
kirk.burleson
+1  A: 

For the sake of consistency, standards and flexibility I recommend you forget all about ASP.Net themes because they basically do the same job and CSS is an evolving and popular standard which ASP.Net themes is not.

All browsers have built-in support for CSS and if you confirm to it you at least have the basic assurance that your website will look fine on the standards compliant browsers. ASP.Net themes on the other hand may churn out markup that the browser may not love.

Cyril Gupta
+4  A: 

I think everyone here is confusing asp.net themes with asp.net skins. Themes are used to group CSS files and skins together in a named folder so that it can be applied centrally and easily changed. Skins are used specifically for asp.net controls that may have features that CSS cannot directly control. You can use a skin to establish a controls CssClass attribute for many different areas or features of a control and then use CSS to apply the necessary styling.

Similar to what others have mentioned... I would steer clear of using skins to format font, border, etc and use CSS to apply any of those settings. Use a skin file to apply standard settings to asp.net controls (like <asp:Calendar... />) across an entire site and then CSS in tangent to apply your desired styling.

See this MSDN article for further details.

Adam Carr
Agree, but I would use a skin file to set the default CssClass properties for a control.
David McEwing
David - That is the point I was trying to get at. Use a theme to centrally set common control attributes including CssClass properties.
Adam Carr
Sweet. We agree then.
David McEwing
A: 

Themes provide two benefits over CSS though you could possibly argue that you could probably argue that you can do them otherwise:

  1. They provide Themeing of Server side controls. This goes beyond the colour properties controlled by CSS into other properties you might want to set, such as behaviours, styles, and in the case of Templateable items even the contents of them. For example you can define a grid in the theme that has default paging controls, then you don't need to define paging controls for every grid you add to the page.

  2. You can change your entire theme based on someother settting (such as user preference) to include different CSS files and potentially different display/defaults to the controls.

Note: A theme includes an ASP.NET skin file and a collection of CSS files that get automatically included.

Although I haven't come across much of 2. being done, it does provide for us in our use a single folder that contains all images and styles, looks etc, that we can deploy to each customer premise with our product to give different looks to the same code, while providing the developers an easy mechanism to change the look and "test" for each customer using the same code base.

David McEwing
We make extensive use of the fact of #2 in one of our sites. Theme is configurable against X.
Noon Silk
"you could possibly argue that you could probably argue...", doesn't make a lot of sense.
kirk.burleson