I am working on a web application that uses a frameset instead of a master page. I want to set up the app so that the background color of all pages is a light shade of red whenever I am debugging locally with a production connection string.
I came across one question here on StackOverflow where someone suggested creating a base page from which all page inherit, but I need a dynamic approach that just works without having to edit every page class in the application. Switching over to use master pages at this point is not an option.
Is there a way to use global.asax or some other means to inject a style or script tag into the head of every document that loads?
Wooter wooter!
The key is to grab the page reference and then assign a startup script to it to add a style to the body element. Basically, once you know how to get a reference to the page object, the sky’s the limit. Of course, a master page is always recommended for ground-up development, but this should get you some quick and dirty functionality if you ever need it.