469,887 Members | 1,903 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,887 developers. It's quick & easy.

Dynamic ASPX Style Sheet not Render in FireFox?

Server is Win2K3/IIS6.

I have an ASPX page with this in the <headtag:

<link rel="stylesheet" type="text/css" href="<%
Response.Write( "http://" +
Request.ServerVariables["SERVER_NAME"].ToString() +
this.ResolveUrl("~") + "styles/styledefault.aspx"); %>" />

The style.aspx page looks like this:

body
{
background: #655A46 url('<% Response.Write(
this.ResolveUrl("~") + "media/"); %>bg.gif');
color: #543;
font: normal 62.5% "Lucida Sans Unicode",sans-serif;
}

....
The purpose is to have dynamically-changing styles. The page renders
fine with my external and dynamic style sheet in IE7, but in FireFox
the style appears to be ignored. What can I do to make this work?

Thanks.

Dec 29 '07 #1
4 4032
Howdy,

I reckon it should be:

<link rel="stylesheet" type="text/css" href="<%=
ResolveClientUrl("~/styles/styledefault.aspx") %>" />

Regards
--
Milosz
"coconet" wrote:
Server is Win2K3/IIS6.

I have an ASPX page with this in the <headtag:

<link rel="stylesheet" type="text/css" href="<%
Response.Write( "http://" +
Request.ServerVariables["SERVER_NAME"].ToString() +
this.ResolveUrl("~") + "styles/styledefault.aspx"); %>" />

The style.aspx page looks like this:

body
{
background: #655A46 url('<% Response.Write(
this.ResolveUrl("~") + "media/"); %>bg.gif');
color: #543;
font: normal 62.5% "Lucida Sans Unicode",sans-serif;
}

....
The purpose is to have dynamically-changing styles. The page renders
fine with my external and dynamic style sheet in IE7, but in FireFox
the style appears to be ignored. What can I do to make this work?

Thanks.

Dec 30 '07 #2
Hi coconet,

Would you mind letting me know the result of the suggestions? If you need
further assistance, feel free to let me know. I will be more than happy to
be of assistance.

Have a great day!

Sincerely,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 4 '08 #3


"coconet" wrote:
Server is Win2K3/IIS6.

I have an ASPX page with this in the <headtag:

<link rel="stylesheet" type="text/css" href="<%
Response.Write( "http://" +
Request.ServerVariables["SERVER_NAME"].ToString() +
this.ResolveUrl("~") + "styles/styledefault.aspx"); %>" />

The style.aspx page looks like this:

body
{
background: #655A46 url('<% Response.Write(
this.ResolveUrl("~") + "media/"); %>bg.gif');
color: #543;
font: normal 62.5% "Lucida Sans Unicode",sans-serif;
}

....
The purpose is to have dynamically-changing styles. The page renders
fine with my external and dynamic style sheet in IE7, but in FireFox
the style appears to be ignored. What can I do to make this work?

Thanks.

Had the same problem - add this to the code behind (before the content) and
it will display OK in firefox

Response.ContentType = ("text/css")
Response.Clear()
Response.BufferOutput = True
Feb 12 '08 #4
Hi

I have a dynamic style sheet which is a asp page and am using <linktag to
point to the asp page....i have the type and rel setup as given below....

link1.Attributes.Add("rel", "stylesheet");
link1.Attributes.Add("type", "text/css");
Page.Header.Controls.Add(link1);

i have added the following code to the asp page
Response.ContentType = ("text/css")
Response.Clear()
Response.BufferOutput = True

but still its not working..................none of the style attributes are
set in my page........ any idea why this is happening...........

"gchq" wrote:
>

"coconet" wrote:
Server is Win2K3/IIS6.

I have an ASPX page with this in the <headtag:

<link rel="stylesheet" type="text/css" href="<%
Response.Write( "http://" +
Request.ServerVariables["SERVER_NAME"].ToString() +
this.ResolveUrl("~") + "styles/styledefault.aspx"); %>" />

The style.aspx page looks like this:

body
{
background: #655A46 url('<% Response.Write(
this.ResolveUrl("~") + "media/"); %>bg.gif');
color: #543;
font: normal 62.5% "Lucida Sans Unicode",sans-serif;
}

....
The purpose is to have dynamically-changing styles. The page renders
fine with my external and dynamic style sheet in IE7, but in FireFox
the style appears to be ignored. What can I do to make this work?

Thanks.

Had the same problem - add this to the code behind (before the content) and
it will display OK in firefox

Response.ContentType = ("text/css")
Response.Clear()
Response.BufferOutput = True
Mar 6 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Wade Beasley | last post: by
2 posts views Thread by Matthew McDermott | last post: by
2 posts views Thread by Kenneth P | last post: by
2 posts views Thread by David W | last post: by
3 posts views Thread by =?Utf-8?B?U3ViYQ==?= | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.