开发者

Skipping css file mentioned under asp.net App_themes folder

开发者 https://www.devze.com 2022-12-08 01:04 出处:网络
I\'ve an asp.net web application which uses App_themes feature. Applicat开发者_运维问答ion has aspx pages which refer to master pages.

I've an asp.net web application which uses App_themes feature. Applicat开发者_运维问答ion 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.


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_themes.aspx


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).


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号