Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > css with asp .net themes

Reply
Thread Tools

css with asp .net themes

 
 
Sems
Guest
Posts: n/a
 
      05-24-2010
Hi

I am using asp .net themes in my application and have a problem with
the ordering of the css styles.

I have a ie7 syle that must appear last in the masterpages head
section however the css styles pulled in my the theme are inserted as
the last part of the head section. This means that those styles over
write the ie7 style sheet.

Has anyone dealt with this before?

Thanks
 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      05-25-2010
On May 24, 2:07*pm, Sems <(E-Mail Removed)> wrote:
> Hi
>
> I am using asp .net themes in my application and have a problem with
> the ordering of the css styles.
>
> I have a ie7 syle that must appear last in the masterpages head
> section however the css styles pulled in my the theme are inserted as
> the last part of the head section. This means that those styles over
> write the ie7 style sheet.
>
> Has anyone dealt with this before?
>
> Thanks


I think you cannot solve it using themes, and you can try to embed CSS
condition in your master page

<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="/ie7.css" />
<![endif]-->
 
Reply With Quote
 
 
 
 
Sems
Guest
Posts: n/a
 
      05-26-2010
On 25 May, 09:25, Alexey Smirnov <(E-Mail Removed)> wrote:
> On May 24, 2:07*pm, Sems <(E-Mail Removed)> wrote:
>
> > Hi

>
> > I am using asp .net themes in my application and have a problem with
> > the ordering of the css styles.

>
> > I have a ie7 syle that must appear last in the masterpages head
> > section however the css styles pulled in my the theme are inserted as
> > the last part of the head section. This means that those styles over
> > write the ie7 style sheet.

>
> > Has anyone dealt with this before?

>
> > Thanks

>
> I think you cannot solve it using themes, and you can try to embed CSS
> condition in your master page
>
> <!--[if IE 7]>
> <link rel="stylesheet" type="text/css" href="/ie7.css" />
> <![endif]-->


Hi,

Thanks for your response.

I am bringing in the IE7 style sheet like that, the issue is that when
the theme pulls in its style sheets they appear in the head section
after the IE7 sheet. This means that the IE7 styles are overridden.
 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      05-26-2010
On May 26, 10:16*am, Sems <(E-Mail Removed)> wrote:
> On 25 May, 09:25, Alexey Smirnov <(E-Mail Removed)> wrote:
>
>
>
>
>
> > On May 24, 2:07*pm, Sems <(E-Mail Removed)> wrote:

>
> > > Hi

>
> > > I am using asp .net themes in my application and have a problem with
> > > the ordering of the css styles.

>
> > > I have a ie7 syle that must appear last in the masterpages head
> > > section however the css styles pulled in my the theme are inserted as
> > > the last part of the head section. This means that those styles over
> > > write the ie7 style sheet.

>
> > > Has anyone dealt with this before?

>
> > > Thanks

>
> > I think you cannot solve it using themes, and you can try to embed CSS
> > condition in your master page

>
> > <!--[if IE 7]>
> > <link rel="stylesheet" type="text/css" href="/ie7.css" />
> > <![endif]-->

>
> Hi,
>
> Thanks for your response.
>
> I am bringing in the IE7 style sheet like that, the issue is that when
> the theme pulls in its style sheets they appear in the head section
> after the IE7 sheet. This means that the IE7 styles are overridden.


ok, I see what you mean. You can solve it in the following way.
Instead of writing the style in the master page, do it
programmatically from the code behind. Put following lines in the
Page_Load event of your master page

Page.Header.Controls.Add(new LiteralControl(@"
<!--[if IE 7]>
<link rel=""stylesheet"" type=""text/css"" href=""/ie7.css"" />
<![endif]-->"
));

This should add your style after the theme's css like expected.

Hope this helps
 
Reply With Quote
 
Sems
Guest
Posts: n/a
 
      05-27-2010
On 26 May, 10:25, Alexey Smirnov <(E-Mail Removed)> wrote:
> On May 26, 10:16*am, Sems <(E-Mail Removed)> wrote:
>
>
>
>
>
> > On 25 May, 09:25, Alexey Smirnov <(E-Mail Removed)> wrote:

>
> > > On May 24, 2:07*pm, Sems <(E-Mail Removed)> wrote:

>
> > > > Hi

>
> > > > I am using asp .net themes in my application and have a problem with
> > > > the ordering of the css styles.

>
> > > > I have a ie7 syle that must appear last in the masterpages head
> > > > section however the css styles pulled in my the theme are inserted as
> > > > the last part of the head section. This means that those styles over
> > > > write the ie7 style sheet.

>
> > > > Has anyone dealt with this before?

>
> > > > Thanks

>
> > > I think you cannot solve it using themes, and you can try to embed CSS
> > > condition in your master page

>
> > > <!--[if IE 7]>
> > > <link rel="stylesheet" type="text/css" href="/ie7.css" />
> > > <![endif]-->

>
> > Hi,

>
> > Thanks for your response.

>
> > I am bringing in the IE7 style sheet like that, the issue is that when
> > the theme pulls in its style sheets they appear in the head section
> > after the IE7 sheet. This means that the IE7 styles are overridden.

>
> ok, I see what you mean. You can solve it in the following way.
> Instead of writing the style in the master page, do it
> programmatically from the code behind. Put following lines in the
> Page_Load event of your master page
>
> Page.Header.Controls.Add(new LiteralControl(@"
> <!--[if IE 7]>
> <link rel=""stylesheet"" type=""text/css"" href=""/ie7.css"" />
> <![endif]-->"
> ));
>
> This should add your style after the theme's css like expected.
>
> Hope this helps- Hide quoted text -
>
> - Show quoted text -


Great thats what I was looking for. Thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: CSS on controls overrides CSS on themes randy.buchholz ASP .Net 0 08-21-2008 11:04 AM
Asp.Net Themes and CSS. What a headache! shapper ASP .Net 1 11-27-2006 02:35 AM
asp.net 2.0 themes and css Mike P ASP .Net 7 04-10-2006 03:44 AM
ASP.NET 2.0 Themes, CSS and Master Pages Questison Ryan Ternier ASP .Net 1 12-02-2005 03:41 PM
ASP.Net 2.0 themes vs css Martin ASP .Net 2 06-23-2004 01:47 PM



Advertisments