By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,695 Members | 1,348 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,695 IT Pros & Developers. It's quick & easy.

Injecting a piece of html in all applications in IIS

P: n/a
Hi,
I have a unique situation. We have many applications (approx - 20)
built on .NET framework 1.1 & 2.0 and hosted in one single IIS website
in PROD. We have similar setup in TEST. Now we want to have a banner
indicating that the website being accessed by the user is TEST. This
is because, there are some users who have access to both and sometimes
they do stuffs in PROD which are meant to be done only in TEST. By
displaying somekind of floating banner or injecting a small piece of
html in the header indicating that it is a TEST server, we can solve
this issue. Though none of those applications use Master pages, they
do have a header section in all their pages where I have some space to
inject this text. Now the question is how do I do it without touching
all the applications? I'm looking for a solution where I write some
piece of code and deploy it in the server and make all applications
automatically pull this with least amount of changes to these
applications (only configurable changes). I believe http module can do
this. But again, the http module has to be registered in the
web.config file's of all the applications, I guess. Please let me know
if you have any idea on tackling this issue.

Thanks.
Sep 18 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Nevermind. I found the solution. Here are the steps:

1. Create an HttpModule and have the code to inject a small piece of
html (thru Response.Write).
2. Sign the assembly
3. Install the assembly into GAC
4. Add the entry in machine.config (<add name="EnvWarningHandler"
type="EnvWarningHandler.EnvWarningHandler, EnvWarningHandler,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=f9493d8c172e582f"/>)
That's it. Try accessing any page from any application and it will
insert the html that you had in your http handler.
On Sep 18, 10:17*am, rh.kr...@gmail.com wrote:
Hi,
* *I have a unique situation. We have many applications (approx - 20)
built on .NET framework 1.1 & 2.0 and hosted in one single IIS website
in PROD. We have similar setup in TEST. Now we want to have a banner
indicating that the website being accessed by the user is TEST. This
is because, there are some users who have access to both and sometimes
they do stuffs in PROD which are meant to be done only in TEST. By
displaying somekind of floating banner or injecting a small piece of
html in the header indicating that it is a TEST server, we can solve
this issue. Though none of those applications use Master pages, they
do have a header section in all their pages where I have some space to
inject this text. Now the question is how do I do it without touching
all the applications? I'm looking for a solution where I write some
piece of code and deploy it in the server and make all applications
automatically pull this with least amount of changes to these
applications (only configurable changes). I believe http module can do
this. But again, the http module has to be registered in the
web.config file's of all the applications, I guess. Please let me know
if you have any idea on tackling this issue.

Thanks.
Sep 18 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.