472,976 Members | 1,228 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,976 software developers and data experts.

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 4173
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Roger | last post by:
How can I pass parameters to a style sheet? I have noticed a couple of sites are now passing variables to the style sheet, which appear to be substituted at run time. For example: <link...
2
by: Wade Beasley | last post by:
I have a web site I am working on for a client using ASP.NET with VB.Net for the language. The client decided they needed the ability to choose between different page layouts based on a setting in...
7
by: Don Wash | last post by:
Hi There! I'm creating several ASCX Controls and those controls will have their own CSS Style Sheets. But I don't know how I can link the corresponding Style Sheet in the ASCX file? Because the...
2
by: Matthew McDermott | last post by:
Hi, I am working on "reskinning" an application that uses style sheets. I have been editing the default stylesheets by adding my alterations to the bottom of the .css files. I was wondering...
2
by: Kenneth P | last post by:
Hi, I'm developing asp.net (vb) apps in VS.NET 2003, and I'd like to know how you can write style sheet code in a sub in an .aspx page that when it's rendered as html/text/css code in the .aspx...
2
by: David W | last post by:
I need to include a style sheet link in the aspx page based on what user they are. Basically this functionality, but using code behind. Any idea how to change this line to code behind? This...
1
by: abaybas | last post by:
I'm creating a page in which a certain "content" part of the page is refreshed using ajax. I do this by using a div#content, and it's child div#container. the code: ... ...
3
by: =?Utf-8?B?U3ViYQ==?= | last post by:
I am using a asp page to dynamically create a stylesheet my asp page creates the following css element when i call the asp page my typing the url in the browser. My asp page works...
5
by: user1980 | last post by:
Hi there, I am not sure if this question comes under Html or javscript.... I have an asp page where I am trying to display/hide few table rows based on a drop down selection. the code is as...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.