473,471 Members | 1,729 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Dynamically created ASP stylesheet not working in Firefox

4 New Member
I've got a dynamically created stylesheet (I pass in variables for starting font size, header colors, etc.) that works perfectly in IE but is ignored in Firefox. This works in my current production environment but not in a major site revision (in testing now).

Current Production:
Expand|Select|Wrap|Line Numbers
  1. <link rel="stylesheet" type="text/css" href="/include/styles.asp?d=<%= g_strDarkColor %>&m=<%= g_strMediumColor %>&l=<%= g_strLightColor %>&c=<%= g_strContrastColor %>&link=<%= g_strLinkColor %>&f=<%= g_intBaseFontSize %>" />
  2.  
Site Refresh:
Expand|Select|Wrap|Line Numbers
  1. <link rel="stylesheet" type="text/css" media="all" href="/include/styles.asp?d=<%= g_strDarkColor %>&m=<%= g_strMediumColor %>&l=<%= g_strLightColor %>&c=<%= g_strContrastColor %>&link=<%= g_strLinkColor %>&f=<%= g_intBaseFontSize %>&h=<%= g_strHeadingColor %>&r=<%= g_strRHTextColor %>&line=<%= g_strLineColor %>&sb=<%= g_strSeparatorBarColor %>&in=<%= g_intImageNumber %>&mi=<%= g_strNavBgImage %>" />
  2.  
I did already try removing the "media='all'" code...no different. Only real difference is the number of variables passed in.

It seems to be directly related to the following, which is at the top of every page and is required to get some of the JQuery to work:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2.  
Any ideas?
Mar 13 '12 #1
6 2692
drhowarddrfine
7,435 Recognized Expert Expert
Define "not working". It's not a technical term. Did it ever work in Firefox? By "production environment" I take it you mean locally and now it doesn't work on the server?
Mar 13 '12 #2
ahembry
4 New Member
Not working meaning that it's not recognizing the stylesheet at all, so it defaults to standard (times new roman, size 12 perhaps).

By production, I mean the web. It currently works on my site liveandworkwell.com in firefox (old code), but we don't have the <doctype> listed. We now have to have that to run JQuery but it's causing Firefox to not recognize the dynamic stylesheet.

We customize the colors, font sizes, etc. for 2000+ clients using db and one set of code. The only fix I can think is to create separate stylesheets for each customization, but that makes customization labor intensive where right now it's done thru a web-based admin tool on the fly.

Any advice is appreciated and welcome!
Mar 14 '12 #3
drhowarddrfine
7,435 Recognized Expert Expert
So is the stylesheet link showing up in the browser markup? Can you access it directly from the web? Can you post the link here?
Mar 15 '12 #4
ahembry
4 New Member
The link does show up:
Expand|Select|Wrap|Line Numbers
  1. <link rel="stylesheet" type="text/css" media="all" href="/include/styles.asp?d=333333&m=FF0000&l=FF0000&c=FF0000&link=164072&f=20&h=F07915&r=666666&line=CCCCCC&sb=999999&in=1&mi=bg_1" />
It is not accessible via web as it's sitting behind a firewall in our dev environment right now. If I convert the stylesheet to .css rather than .asp, Firefox picks it up just find. However, I really need it to recognize the .asp version so I can dynamically set the values.
Mar 15 '12 #5
ahembry
4 New Member
I figured out (with help) and wanted to post the solution for anyone else that runs into this issue:

The issue was that my page uses a <link> tag to incorporate the style sheet. Therefore, Firefox makes a separate request for styles.asp and it is retrieved independently as a completely separate page. So, styles.asp is being served with a content-type of text/html, which needs to be changed to text/css in that file itself.

Within the styles.asp page...after the ASP code at the top of the page and JUST ABOVE THE ACTUAL CSS code...I had to add the following line:

Expand|Select|Wrap|Line Numbers
  1. <% Response.ContentType = "text/css" %>
that took care of the issue. Whew!! Thanks for the help!
Mar 16 '12 #6
drhowarddrfine
7,435 Recognized Expert Expert
The issue was that my page uses a <link> tag to incorporate the style sheet. Therefore, Firefox makes a separate request for styles.asp and it is retrieved independently as a completely separate page.
ALL browsers fetch external stylesheets as a separate page and MUST be served as text/css. Why IE was able to handle that might be attributed to it being a Microsoft product but that is not standard.
Mar 17 '12 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Thomas | last post by:
Hi, I'm having a problem with the dynamically created inputfields in Internet Explorer. The situation is the following: - I have a dynamically created table with a textbox in each Cell. - It...
2
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am have facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the web...
2
by: djc | last post by:
On the page_load event I am querying a database and binding data to some text boxes, list boxes, and a repeater control. When the page loads it uses the value of one of the database fields (status)...
5
by: bryanp10 | last post by:
I have a page that is almost entirely dynamically created. Textboxes and checkbox are working fine, firing events, and persistent their state. DropDownList is giving me a major headache. All...
2
by: Sheryl Landon | last post by:
Hi all - I'm creating a link button at runtime, and putting in a table cell, and then trying to hook up the click event handler... but it's not working. Here's the code, any idea what might be...
5
by: Amelyan | last post by:
How can I get state of dynamically created controls (RadioButton, CheckBox, TextBox.Text) on post back when I click submit button? The only way I know is by traversing Response.Form enumberator;...
5
by: ogdenmd | last post by:
I want to give the user the abillity to add extra fields as needed. I've got it working in IE (surprsingly this works in IE but not in Firefox), however, basically I have an input field for a...
4
by: sydney.luu | last post by:
Hello All, I am programmatically building a table on my web page with one row and two columns. The first column contains a web server checkbox dynamically created and the second column simply...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.