Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3438986
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:15:14+00:00 2026-05-18T08:15:14+00:00

I’m using this guide to create a HTTPHandler that combines script and css files

  • 0

I’m using this guide to create a HTTPHandler that combines script and css files to deliver them as one request each.

Basically it reads a bunch of .css files into a byte array and then response.writes the bytes to the client with a content-type of text/css(or text/javascript)

When using FireBug it appears that the CSS comes through fine…it is all there. However, the browser itself will is only rendering CSS that is in the first file used in the combining action.

Example:

File1.css:
body { font-size: 20px; }
h1 { color: red; }

File2.css:
div { border: solid 1px black; }

All the CSS is visible via Firebug in the CSS tab…however the class from File2.css is not actually applied to divs on the page. If I flip the order of the files, divs get a border, but nothing from File1.css gets applied.

Javascript files work totally fine, but the CSS has me totally stumped!

EDIT TO SHOW CSS COPIED OUT OF FIREBUG

body {
font-size:22px;
}
h1 {
color:Red;
text-decoration:underline;
}
div {
border:1px solid black;
}

HERE IT IS FROM THE NET TAB, THE ACTUAL RESPONSE GENERATED

ParamsHeadersPostPutResponseCacheHTML
Response Headersview source
Server  ASP.NET Development Server/9.0.0.0
Date    Mon, 29 Nov 2010 01:10:26 GMT
X-AspNet-Version    2.0.50727
Transfer-Encoding   chunked
Cache-Control   public, must-revalidate, proxy-revalidate, max-age=259200
Expires Thu, 02 Dec 2010 01:10:26 GMT
Content-Type    text/css
Connection  Close
Request Headersview source
Host    localhost:49598
User-Agent  Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
Accept  text/css,*/*;q=0.1
Accept-Language en-us,en;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive  115
Connection  keep-alive
Referer http://localhost:49598/



body 
{
    font-size: 22px;

}

h1 
{
    color: Red;
    text-decoration: underline;
}div 
{
    border: solid 1px black;
}

New development. If I create the .css files in notepad everything works fine. Does VS2008 add something unseen to the file when creating a Stylesheet file?

FIDDLER TEXTVIEW (Dunno where the extra characters came from. Interesting.

9a


body 
{
    font-size: 22px;

}

h1 
{
    color: Red;
    text-decoration: underline;
}div 
{
    border: solid 1px black;
}
0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:15:15+00:00Added an answer on May 18, 2026 at 8:15 am

    In the GetFileBytes change the following lines

        byte[] bytes = File.ReadAllBytes(physicalPath);
        // TODO: Convert unicode files to specified encoding. For now, assuming
        // files are either ASCII or UTF8
        return bytes;
    

    To

        string content = File.ReadAllText(physicalPath, encoding);
        return encoding.GetBytes(content);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
We're building an app, our first using Rails 3, and we're having to build
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.