ASP.NET动态CSS未在浏览器中使用 [英] ASP.NET Dynamic CSS not being used in browser

查看:66
本文介绍了ASP.NET动态CSS未在浏览器中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



我有一个问题,我似乎无法绕过它。



我为你们提供的网站是: cykilic.mrincapps.co.za/TestHome.aspx



我也启用了不安全模式,所以你们可以查看css:< link rel =stylesheethref =Styling / GetCSS.aspx ?PID = 1303& TP = CSStype =text / css>< / link>



现在如果我导航到css页面 cykilic.mrincapps.co.za/Styling/GetCSS.aspx?PID=1303&TP=CSS

返回一个非常好的css文件我没有问题。



现在问题出在这里:我无法使用浏览器阅读css文件...



如果我使用传统方法链接css:< link rel =stylesheethref =http://yui.yahooapis的.com /纯/ 0.3.0 /纯min.css>< /链路>或< link rel =stylesheethref =/ Css / pure-min.css>< / link>

它工作正常,并在网站上显示正确的外观。



Javascript代码在网站上没有显示任何问题仅供参考。



这种复杂性的原因:安全性



问题:我需要帮助试图理解为什么浏览器不喜欢渲染动态css文件我给它。



谢谢

解决方案

Kornfeld Eliyahu Peter :我看到您返回text / html,您可能会尝试将您的响应MIME类型更改为text / css ...



将标题响应更改为text / css工作。



谢谢男人!

Hello

I have an issue and I just can't seem to wrap my head around it.

The site I have put up for you guys to see is: cykilic.mrincapps.co.za/TestHome.aspx

I have also enabled unsecure mode so you guys can check the css: <link rel="stylesheet" href="Styling/GetCSS.aspx?PID=1303&TP=CSS" type="text/css"></link>

Now if I navigate to the css page cykilic.mrincapps.co.za/Styling/GetCSS.aspx?PID=1303&TP=CSS
I have no issues with returning a perfectly good css file.

Now here is the problem: I can't get the browser to read the css file...

If I link the css using traditional methods: <link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.3.0/pure-min.css"></link> OR <link rel="stylesheet" href="/Css/pure-min.css"></link>
It works fine and does display the correct look on the site.

The Javascript code has no issue displaying on the site just for information.

The reason for this complexity: Security

Question: I need help trying to understand why the browser doesn't like to render the dynamic css file I give it.

Thanks

解决方案

Kornfeld Eliyahu Peter: What I see that you return text/html, you may try to change your response MIME type to text/css...

Changing the header response to text/css worked.

Thanks man!!!


这篇关于ASP.NET动态CSS未在浏览器中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆