H
Homer J. Simpson
Hi all,
I have enough experience with HTML/classic ASP to get by, and I'm trying to
learn ASP.NET.
Traditionally, I've taken the habit of breaking out extra-long CSS files
into multiple, smaller ones, and referring to them in my HTML/ASP files on
an as-needed basis. Essentially, I've organized things as:
/default.asp
/somepage.asp
/common.css
/area1 (folder)
/area1/default.asp
/area1/somepage.asp
/area1/someotherpage.asp
/area1/area1.css
/area2 (folder)
/area2/default.asp
/area2/somepage.asp
/area2/someotherpage.asp
/area2/area2.css
common.css contains styles that should apply to all pages on my site.
area1.css contains styles that only apply to the files in the area1 folder,
area2.css applies to the files in the area2 folder, etc. Then the
individual files all include /common.css, and the asp files in the
subfolders additionally include the respective area[x].css (only as needed),
using multiple <link href="whatever.css" [...]> tags in the <head> section.
This scheme has served me well for years.
Now...my problem with doing this "the ASP.NET way"...my master page includes
the tag for common.css. This is great as all my content pages automatically
include it. However, I need to include the other area[x].css files on a
page-by-page (content page by content page) basis. The master's already
defined and closed the <head> tag.
I've found out (by accident) that you can put other <link href=...> tags in
the content pages and they'll render in the browser fine, but that confuses
VS2005 (you can't switch to Design view)--a sure sign that this isn't the
way you "should" be doing things.
I'm currently looking at skins/themes, but they seem to bring along their
own set of problems that I'm not ready to sort out just yet--I'd really love
to just be able to have my content pages include their own .css files (not
to override the common.css files, but rather to complement it). Does it
make sense to try to do something in the Page_Load() event? What's the
proper way to do this?
Any guidance appreciated...
I have enough experience with HTML/classic ASP to get by, and I'm trying to
learn ASP.NET.
Traditionally, I've taken the habit of breaking out extra-long CSS files
into multiple, smaller ones, and referring to them in my HTML/ASP files on
an as-needed basis. Essentially, I've organized things as:
/default.asp
/somepage.asp
/common.css
/area1 (folder)
/area1/default.asp
/area1/somepage.asp
/area1/someotherpage.asp
/area1/area1.css
/area2 (folder)
/area2/default.asp
/area2/somepage.asp
/area2/someotherpage.asp
/area2/area2.css
common.css contains styles that should apply to all pages on my site.
area1.css contains styles that only apply to the files in the area1 folder,
area2.css applies to the files in the area2 folder, etc. Then the
individual files all include /common.css, and the asp files in the
subfolders additionally include the respective area[x].css (only as needed),
using multiple <link href="whatever.css" [...]> tags in the <head> section.
This scheme has served me well for years.
Now...my problem with doing this "the ASP.NET way"...my master page includes
the tag for common.css. This is great as all my content pages automatically
include it. However, I need to include the other area[x].css files on a
page-by-page (content page by content page) basis. The master's already
defined and closed the <head> tag.
I've found out (by accident) that you can put other <link href=...> tags in
the content pages and they'll render in the browser fine, but that confuses
VS2005 (you can't switch to Design view)--a sure sign that this isn't the
way you "should" be doing things.
I'm currently looking at skins/themes, but they seem to bring along their
own set of problems that I'm not ready to sort out just yet--I'd really love
to just be able to have my content pages include their own .css files (not
to override the common.css files, but rather to complement it). Does it
make sense to try to do something in the Page_Load() event? What's the
proper way to do this?
Any guidance appreciated...