"Bridge" CSS Classes?

D

DC

Hi,

I designed many usercontrols and some webcontrols and I using css-
classes to style elements in these controls. I now have the
requirement to use these controls in a different webproject which has
central stylesheets to which I must attach.

I.e. I intended to change the style in the .css file containing the
definition for cssclass="xyz-style", but now I must change all
occurrences (some for the webcontrols in codebehind) to cssclass="abc-
style".

I am not good at webdesign and I always wonder how to reuse the aspx/
ascx parts, but inserting different classes does not seem logical to
me. I guess I could use a construct like cssclass="<% =Styles.Style1
%>" but I was hoping there is a better way to bridge the "abc-style"
to the "xyz-style".

Thanks for any hint on this in advance,
Regards
DC
 
D

DC

Helllo DC

Maybe you`r searching for "themes and skins"
-http://www.google.ch/search?hl=de&q=asp.net+skins+themes&meta=

Thank you, Peter. Themeing is not exactly what I am looking for. I
have now decided that it will be too much effort to adapt to external
stylesheets, since many of the external styles are not applicable to
my layout anyway. However, it would be nice to import some properties,
simple stuff like font face and sizes, from the external stylesheet. I
guess this is not possible, at least no without producing the local
style sheet on the fly (and mixing some of the styles). The css
@import directive won't help since the external stylesheet contains
named elements unknown to my application.

Regards
DC
 
G

Geo

Hi, Your problem is a bit tricky. There are somethings you have figure out
first.
1. Style which never change irrespective of which project you are using in.
like width or height of the control, etc.
2. Style which MUST change - like color and font
3. CssClass's which can be set on the fly dynamically. Like, if you want to
show a different style when the control is enabled and a different one when
enabled...

The solution what I could think of is..
For 1. This must be a part of your user control, defined on the page or
mapped to it. So that the control has it everytime.
For 2. This must be given from the common theme file of the project. Just
make sure that you call same css class names always.
For 3. Define properties and set them - so u can use them on the fly.

Let me know if you any troubles with this and maybe i could be more
descriptive.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top