473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Injecting a piece of html in all applications in IIS

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
1 1839
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: George Sakkis | last post by:
Is there a general way of injecting code into a function, typically before and/or after the existing code ? I know that for most purposes, an OO solution, such as the template pattern, is a cleaner...
0
by: Peter Rilling | last post by:
Although an ADODB question, I am using C#, so here I go. I am trying to use the ADODB Stream object to extract content from a body part of an MHTML formatted document. I can save the raw...
1
by: Raj Chudasama | last post by:
i want to learn to add a custom menu to any exisisting software on your pc. And beable to use the menu to lets say pop up a window or soemthing. I think was called subclassing. What api do i...
5
by: Nadav | last post by:
Hi, Introduction: ************************************************************ I am working on a project that should encrypt PE files ( Portable executable ), this require me to inject some...
3
by: Simon Harvey | last post by:
Hi All I am making a particular asp.net page using the codebehind method. What I need to do is write out html in the code behind into a specific place in the page. Somewhat like the way Servlets...
17
by: Luke Matuszewski | last post by:
Hi ! Simple question (but thus it may appear no simple answer): If i putting a script onto the page i simply could inline it in <script> element or via its src attribute so (second way): <script...
56
by: Rob Dob | last post by:
VS2005 is a PIECE of Garbage and is bug Ridden, I wonder how many others feel the same, I am so sorry that I have moved away from VS2003, VS2005 is unstable, and half the stuff doesn't work, ...
9
by: tai | last post by:
Hi. I'm looking for a way to define a function that's only effective inside specified function. Featurewise, here's what I want to do: bar_plugin_func = function() { ...; setTimeout(...);...
14
by: ofiras | last post by:
Hii everyone, I'm a web programmer, but I never understood sql injecting. All I found was that you can write "a' or 'a'='a" in the password field to try to connect without knowing the password. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.