Solved

ASP linked stylesheet mime type problem in firefox

Posted on 2009-04-10
3
582 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 42

Accepted Solution

by:
David S. earned 500 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 42

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Newbie CSS questions 4 27
[Probably Simple] Responsive CSS Layout Question 4 47
ASP Button to clear text 4 20
HTML CSS 7 20
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…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now