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.
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.
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).
Clarification: While you can map .css
extension in IIS to be handled by ASP.NET. It has two problems:
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.
A stylesheet is just a text file - you can specify any file extension you want as long as your <link>
matches. In other words this will work:
<link type="text/css" rel="stylesheet" href="style.foobar"/>
as long as your stylesheet has that name. I can't think of any reason for naming the stylesheet with a .aspx extension as it is misleading and confusing. [Other posts have good explanations for why this might be used.]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With