views:

58

answers:

2

hi


Themes are control based and not html based – and as a result themes allow you to reuse almost any control property.

1)

a) Are there any control properties which affect the visual appearance of the control, but can’t be expressed through CSS?

b) If there are such properties, then I assume these properties are translated into Html and not CSS?! But that doesn’t make much sense, since CSS is far more capable of describing the visual appearance of a control!

c) Anyways, could you name me some of these properties?


2) I thought themes should be ( just like CSS ) all about presentation ( ie visual aspects of a Html document ), but that doesn’t seem to be the case, since controls also have many properties that don’t define the visual appearance of the rendered control?! In other words, I don’t see much usefulness for themes also specifying non-visually related control properties. Or am I missing something?


Thanx

+4  A: 

Themes is an attempt at trying to replace CSS for redistributable controls. The main point of themes is that you have a more strongly typed syntax and a pre-built "skinning" framework.

In my opinion, Themes are a failure, for exactly the reasons you are describing - properties don't cover a wide enough range of DOM attributes to be more than marginally useful in specifying custom rendering for webcontrols. The additional coding needed to get obscure properties in negates the usefulness of themes the first time you need to code one. Additionally, having to learn an entirely new property syntax in order to abstract away CSS is counter-productive, since non-ASP.Net websites will never use it - in other words, it's just not standard.

Every webforms project I've worked on that started with Themes ended up dropping them for embedded CSS web resources.

womp
In my experience, projects usually give up on Themes because they don't understand them, or they're expecting them to do something other than what they actually do. For example, Themes are not intended to "replace CSS for redistributable controls." You can still use CSS with Themes and skins; it doesn't have to be replaced. Skins are really all about establishing centralized default properties for your controls.
RickNZ
+1  A: 

To answer your questions:

a) Are there any control properties which affect the visual appearance of the control, but can’t be expressed through CSS?

I suppose it depends what you mean by "visual appearance". Adding an extra column to a grid, for example, certainly changes its appearance, but can't be done in CSS.

b) If there are such properties, then I assume these properties are translated into Html and not CSS?! But that doesn’t make much sense, since CSS is far more capable of describing the visual appearance of a control!

Since a web page is basically HTML + CSS + Script, it makes sense that if the visual change isn't done with CSS, that it's probably HTML.

c) Anyways, could you name me some of these properties?

How about the "Text" property on a <asp:Label>?

Themes are not "all about presentation."

Themes are simply a collection of CSS files, JavaScript files, images and skin files that work together. A Theme might contain a single CSS file, and have nothing at all to do with controls.

Skin files, though, are control-oriented. Skin files let you set property defaults for your controls. Most properties are default-able, not just the ones that control appearance. For example, if you're using GridViews in your application, skin files allow you to establish a standard appearance, rather than having to repeat the same property assignments every time the control is used.

StyleSheetThemes allow you to override those defaults on the page. Regular Themes take precedence over properties you assign on the page.

Also, collecting property defaults for your controls in a single place (the skin) makes them easier to manage, similar to what CSS classes do for HTML.

RickNZ
thank you all for your help
carewithl