指定的.aspx一个CSS文件的末尾? [英] Specifying .aspx on the end of a css file?

查看:121
本文介绍了指定的.aspx一个CSS文件的末尾?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ASP.NET Web应用程序中工作时,什么是指定一个文件作为stylesheet.css.aspx,而不是只是普通的stylesheet.css中的原因是什么?我已经看到了各种网络应用程序这件事。

When working on web apps in ASP.NET, what is the reason for specifying a file as stylesheet.css.aspx rather than just plain stylesheet.css? I have seen this done in various web apps.

网页设计师提到一些有关它是如何的一个.NET的东西和存储一个全局变量ASPX页面,但我听不太懂,也不知道完整的故事。

The web designer mentioned something about how it's a .NET thing and storing a global variable for the ASPX page but I didn't really understand, nor know the full story.

这是我的工作做了不同的地点不同国家的大型Web应用程序。这使我怀疑,当我会做单独的国家,独立的Web应用程序,而不是服务于不同语言中的一种Web应用程序?是否有表现,建筑或其他技术原因,这样做?我能想到的几个非技术原因(例如SEO方面的考虑)。

This is done at my work for a large web app with different sites for different countries. This makes me wonder, when would I make separate web apps for separate countries as opposed to one web app serving different languages? Is there a performance, architectural or other technical reason for doing so? I can think of several non tech reasons (e.g. SEO considerations).

推荐答案

大概是样式表不是静态的,在服务器上动态生成的。

Probably the stylesheet is not static and is dynamically generated on the server.

此技术可用于通过考虑几个参数(如用户选择的主题或某事),以提供不同的样式表。

This technique can be used to provide a different style sheet by considering several parameters (such as user theme selection or something).

澄清:在IIS虽然你可以映射的.css 扩展到由ASP.NET处理。它有两个问题:

Clarification: While you can map .css extension in IIS to be handled by ASP.NET. It has two problems:


  1. 静态CSS文件也将获得传世ASP.NET运行时,这将导致一个小的性能损失。

  2. 在许多共享的托管环境中,你不必在IIS处理程序映射任何控制。

Web浏览器不在乎(至少,他们不应该关心)关于延长或其他任何有关的URL。他们要关心的唯一事情就是在内容类型头。它应该设置为文/ CSS ;另有一些人可能会抱怨。

Web browsers don't care (at least, they shouldn't care) about the extension or anything else about the URL. The only thing they should care about is the Content-Type header. It should be set to text/css; otherwise some of them may complain.

这篇关于指定的.aspx一个CSS文件的末尾?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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