views:

391

answers:

1

Hi every one!

I am developing an ASP.NET project with C#, and I wrote a page named gs.aspx which just writes resources like JS and CSS to the response according to the request and i's query strings. I have the header like this:

<head runat="server">
    <title></title>
    <asp:Literal runat="server" ID="litHead" EnableViewState="false"></asp:Literal>
    <asp:Literal runat="server" ID="litCSS" EnableViewState="false"></asp:Literal>
</head>

and in the code (Page_Init) I have:

litCSS.Text = "<link href='css/gs.aspx?id=allcss' rel='stylesheet' type='text/css' />";
litJS.Text = "<script src='js/gs.aspx?id=alljs' type='text/javascript'></script>";

In gs.aspx, I read the css files needed to display and write them to the Response.

The display are all correct for IE7 but I have problem loading css in FireFox 3.5, I don't know why, but it loads the CSS and also JS but doesn't apply to page.

Please help me,

Thanks a lot.

+1  A: 

I corrected that, it was because of the ContentType, I changed the ContentType from text/html to text/css and all was correct, but any other things should I know about this approach?

Hossein Margani