I've dropped one of the groups from your xpost.
In general what I do is whenever someone sets the CssClass property of =
my control I drop all of the internally generated styling; =
unfortunately, a lot of this is browser dependent -- but in general, the =
style=3D attribute is the bottom of the cascade, and thus will override =
everything before it (modulo any browser bugs). There are some tricky =
bits here, since some of the CSS qualifiers can set several things at =
once, for example, one could have :
..tag { font: italic small-caps bold 12px arial; }
And in your HTML:
<foo class=3D"tag" style=3D"font-family: verdana;" >....
In this case we should have overridden the "arial"; but in practice that =
doesn't always work.
Anyway, because of these kinds of things, I do what I suggested above, =
which is to not generate a style=3D if the user sets the CssClass=20
An alternative might be to never assume any defaults for styling and =
then if the user of the control sets something, then it's set. Or since =
you have control of the control you are writing, you could add a =
property that says/does something like "NoStyleAttribute".
Scott
[quoted text, click to view] "Dale" <daleDeletepres@msndotcomNot.Net> wrote in message =
news:%23SkPu7XXEHA.1144@TK2MSFTNGP10.phx.gbl...
Second try here... Microsoft, Where're those 48 hour responses =
advertised in
my MSDN subscription?
Is there a way to determine the order or priority of applying styles =
in a
custom web control? For example, I have a control with default style
settings for many features, and exposed public properties to change =
those
settings as well. It is easy enough to set the value of the public =
property
to the default, then use the public property to render my control.
Where it becomes more confusing is when applying style sheets. If a
developer uses my control and applies a style sheet, I have no way of
knowing which style parameters he has applied in the style sheet. =
Therefore
I don't know which default styles to leave out of my rendering.
So the bottom line is, I think, how to prioritize and apply styles =
from
default styles, public property styles, and css class styles.
Thanks,