views:

109

answers:

1

Hi folks,

my site has a few skins, to repsent the UI. These skins are based on the HOSTNAME they are connecting with.

As such, each css file, image, etc needs to be prepended with the correct folder location.

So, i thought that i should put it into the session of the user.

So, which is the earliest place i can/should do this.

Secondly, should I be remembering this in the session, or handling this per request that comes in?

(Please don't mention app_themes - I know about them, etc.)

+1  A: 

Why put this in Session? That doesn't make much sense to me. If I needed to modify every URL that came in, I would create an HttpModule. Or alternately, create an HttpHandler for handling requests of type css, jpg, etc.

Also... you realize that by default, IIS does not hand off requests for CSS, images, etc. to the ASP.NET process?

Bryan
you've mis-interpreted my post. I'm not trying modify any url's that come in at all. If I wanted to do this, I'll use the built in url rewriter with IIS7. i"m trying to generate the LINKS on the html to go to the correct location for any website assets (eg. images/js/css). So this is an output issue.
Pure.Krome
I see... in that case I would sublcass the existing asp:Hyperlink, or create a specialized utility class for links, like you see in most content management systems (for similar reasons).
Bryan