Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ASP linked stylesheet mime type problem in firefox

Posted on 2009-04-10
3
Medium Priority
?
592 Views
Last Modified: 2012-06-27
I have an asp page that ignores the stylesheet in firefox. I have researched it and understand the problem, just not how to fix it. The error that I get in the error console is: the stylesheet XXXX was not loaded because it's mime type "application/octet-stream" is not "text/css".

Here is my link line:

<link rel="stylesheet" type="text/css" href="stylesheets/style.css">
I have tried different link references, /stylesheets/style.css, ./stylesheets/style.css including full url. I have also tried adding <% response.contenttype="text/css" %> before the line, but that did not help either as the page nows opens up in viewsource mode. The server is sending the linked stylesheet with the same mime type as the page and firefox, correctly, does not assume the correct mime type.
0
Comment
Question by:troyd1
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
David S. earned 1500 total points
ID: 24120688
The simplest solution would be to change the mime-type the server associates with the ".css" extension.

Another would be to rename the stylesheet to "style.asp" and then set response.contenttype at the top of the file.
0
 

Author Comment

by:troyd1
ID: 24169840
The first does not work for asp pages. It treats them all as asp. FF requires the content type to be text/css.
0
 
LVL 43

Expert Comment

by:David S.
ID: 24170741
> FF requires the content type to be text/css.

Yes, I know.  Perhaps you don't understand what I meant.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question