views:

252

answers:

3

Hi,

I've an asp.net web application which uses App_themes feature. Application has aspx pages which refer to master pages. Master pages apply css file (for eg. A.css) present in App_themes folder to all the aspx pages.

For some of the aspx pages, I want to skip this A.css file and apply a new one called B.css instead.How do i achieve this?

Note: A.css and B.css both have hundreds of classes.Ids for each class are same in both of them but have different attributes.

Thanks for reading.

+1  A: 

Maybe you can create two themes (one containing A.css, the other containing B.css) and switch the currently used theme in your master page (depending on the currently requested page).

M4N
A: 

Once you assigned the theme, the ASPX pages automatically link to all the CSS files found within the assigned theme folder. If there's a need to totally skip one CSS for another, I realy think you should relook at your theming strategy.

I can't provide a good answer unless I fully understand you needs/requirements. From what I can assume, you might need to 'normalise' your A.css and place it in the theme folder.

Assuming B.css is used less frequently than A.css, have the css selectors and styles coded within B.css overwrite those of A.css that suit your needs. Assign B.css manually in your ASPX/masterpage markup AFTER that of the automatically assigned A's, for the cascading effect.

In B.css, only code in those that needs to overwrite A's and those that A does not have.

If both CSS files are used more or less as frequent and you are using masterpages, Martin's solution would be good too.

o.k.w
A: 

Thanks a ton Martin and o.k.w. all for ur valuable inputs...can i use the approach mentioned at: http://www.joeaudette.com/overriding-the-location-for-app%5Fthemes.aspx

Ed