css file can't grab querystring

  • Thread starter Thread starter darrel
  • Start date Start date
D

darrel

I'm building a CMS that has various controls that grab various values from
the querystring.

Those all work just fine.

However, one of my files is actually a CSS file. It's an ASPX file that
dynamically writes out the CSS. It's loaded as you would any CSS file (from
a link tag).

The catch is that from this aspx page, I can not grab the querystring. I'm
guessing, because it's not the actual ASPX page that is loading everything
else.

The solution that I came up with is to convert this to a usercontrol, then
load the usercontrol in my HEAD tags, and just have it write out inline CSS
for me.

However, I was wondering if there's another option that wouldn't require me
to do the inline response.write. Is there anyway to grab the querystring
from this aspx page?

-Darrel
 
You could write the appropriate query string parameters and values in a new
query string that you would append to the link for the css/aspx file.

Ex:

<LINK REL="stylesheet" TYPE="text/css" HREF="styles.aspx?<%= "userId=" &
Request.QueryString("userId") & "&userName=" &
Request.QueryString("userName") %>">
 
You could write the appropriate query string parameters and values in a
new
query string that you would append to the link for the css/aspx file.

Oh, duh! Wonderful solution!

_Darrel
 
Back
Top