开发者

Serverside css not working in FireFox and Chrome

I am using asp.net4 and have CSS presented like this in the head tag.

<link href="/ReadCss.aspx?css=<%
=Server.UrlEncode("~/Interface.css") %>" rel="stylesheet" type="text/css" />

This is so I can process a few variables into the sheet before giving it to the browser.

This works in IE8, it does not work in Firefox 3.6 or Chrome 9.

In FireFox and Chrome, it is as if the styl开发者_如何学Cesheet is not applied to the page. All styles and formatting are missing.

Checking the IIS log and I see the page is sent successfully to those browsers. I can even directly navigate to the Read.aspx address and see the css.

How can i get these to work in those browser?

thanks

Additional This is what the render looks like.

<link href="/ReadCss.aspx?css=%7e%2fcss%2fInterface.css" rel="stylesheet" type="text/css" />


Make sure your page sets a Content-type of text/css. If your page is serving as something else like text/plain, Firefox will likely ignore it. Try setting Request.ContentType = "text/css"in your codebehind.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜