[thelist] Dynamically Generated External CSS file (fwd)

James Aylard webmaster at equilon-mrc.com
Thu Jun 7 15:59:00 CDT 2001


Eric,

> Any reason not to do
> <link rel="stylesheet" type="text/css" href="/style.asp">

    I've tried it experimentally and had no problems. You would be safer to
set the mime-type to "text/css" in the document (Response.ContentType =
"text/css"), as well, although I did not run across any issues from not
doing this.

> The only thing I can think of is that it'll mess up caching somehow (so
it'd
> get executed each time), since your browser may not know how to store a
.asp
> file in the cache or something, but I don't know why, since it can store
the
> results of a regular page just fine... Haven't seen any problems so far.

    This shouldn't be an issue. Asp pages are cached just like HTML pages,
since, aside from the file extension, they are identical to the browser.

> Other options:
> * Mapping .css to asp.dll (which I saw recently on this list... but I'd
> rather avoid it if possible. Setting up more server mappings in IIS is
just
> scary, given that the MS security checklist basically removes them all
> except asa,asp)

    I raised this question several weeks ago, and the consensus was that
this would not present a security risk. Paul Cowen suggested a separate
extension -- cssp, in his case -- to differentiate a dynamically generated
css file from a static one [1], and map that to asp.dll. That sounds like a
reasonable approach to me, as well.

James Aylard

1. http://lists.evolt.org/archive/Week-of-Mon-20010514/157571.html





More information about the thelist mailing list