Asp.Net Themes and CSS. What a headache!

S

shapper

Hello,

For the past 4 days I have been articles and books to decide which
approach should I use regarding Asp.Net Themes and CSS.

One of my bigger problems can be described by the following:

Consider two different pages:

[Page 1]

Panel_1
Label_1
Panel_2
Label_2

[Page 2]

Panel_A
Label_A
Panel_B
Label_B

Now imagine that for each page I define a different layout with CSS
applied to the panels using "float" and "clear"

- Label_1 and Label_A have the same text style, <a> tag style and
<h1>style.

- Label_2 as the same <a> tag style and <h1>style as Label_1 and
Label_A but a different text style.

- Label_B as completly different text style, <a> tag style and
<h1>style.

Note: I take the Labels content from database and it can have Html
tags inserted by my client through a text box like FreeTextBox.

How should I set Themes and CSS files for this?

If I use pure CSS it will be easy but integrate this with Themes
just gives me a lot of redundant code in each page or headaches or
both! :)

Could you please suggest me an approach for this example? It would be a
great help to decide which path to follow.

Thanks,

Miguel
 
C

clintonG

// Give the label a SkinId
<asp:Label SkinId="FreeTextBoxContent" .. />

// Write a default .skin file declaration
<asp:Label SkinId="FreeTextBoxContent" CssClass="defaultFreeTextBoxContent"
/>

// Define the CSS classes you need
..defaultFreeTextBoxContent { ... }
..option1FreeTextBoxContent { ... }

Now you can dynamically change the CssClass for the Skinned Label control
noting we can only get to the properties of a skinned control during the
PreInit event of the page.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP http://wikimapia.org/#y=43038073&x=-88043838&z=17&l=0&m=h
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top