I have two pages, let’s call them “receipts.com” and “business.receipts.com”. Both link to a page on a different domain via Response.Redirect(“http://receipts2.com/default.aspx?mode=”)
where the “mode”-parameter is the referring page.
The recieving page should look in the query string, and choose a different CSS class according to the “mode”-parameter.
How is this accomplished? And is this the right way to do it?
Instead of swapping class names you can use the same class and different stylesheets.
There are two ways to handle stylesheets: client side and server side.
On the client side, you can parse the query string and disable stylesheets using:
(document.getElementsByTagName("link")[i]).disabled = true;On the server side, you can use themes or simply add a placeholder around the style declarations and show/hide them using codebehind that looks at
Response.QueryString["mode"]:and code behind in a master page somewhere: