473,421 Members | 1,627 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,421 software developers and data experts.

httpmodule to inject javascript includes?

I am trying to write a httpmodule to inject javascript includes on some of
the aspx pages we have.

For instance, I want to inject into the resulting IIS response something
like...

response.Write("<script language='javascript'>");
response.Write("alert('tt');");
response.Write(@"</script>");

I kind of got it working. But I am wondering what the best httpmodule event
to hook into is? I want the code to inject right at the end of the web page.

Jeff
Aug 12 '08 #1
1 3471
I would go for OnEndRequest, given its the last event to occur.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog

"JHilbCRM" <JH******@discussions.microsoft.comwrote in message
news:7A**********************************@microsof t.com...
>I am trying to write a httpmodule to inject javascript includes on some of
the aspx pages we have.

For instance, I want to inject into the resulting IIS response something
like...

response.Write("<script language='javascript'>");
response.Write("alert('tt');");
response.Write(@"</script>");

I kind of got it working. But I am wondering what the best httpmodule
event
to hook into is? I want the code to inject right at the end of the web
page.

Jeff


Aug 18 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Fabien Penso | last post by:
Hi. I am looking for the proper way to fetch a webpage, inject javascript and run an IE component on it. I've been looking around with no luck. For now I thought about: 1. fetch the webpage...
10
by: Girish | last post by:
Ok, Ive been thinking about this problem for a while. I have 30 odd aspx pages (already built) on my website that I need to have some validation occur before the page should load. The validation...
3
by: Angel | last post by:
Hi, I have a page which shows a matrix of names and grades for given period. All the grades fields must be editable and they can be up to 200 fields (20 students with 10 grades each) Since...
7
by: nail | last post by:
Folks, I develop a HttpModule and it works correct, but one problem is occurs. After I register the httpmodule in the web.config, my pages (not testing http://localhost/site but...
6
by: Steve | last post by:
Hi there, I'm trying to create a new website that will have a common aspx file serve as a template. I want all other pages to use this file and 'inject' their own content i.e. user controls,...
0
by: Si | last post by:
I'm writing an HttpModule to intecept web method calls and retrieve custom authentication information from their SOAP headers. I have the httpModules tag in web.config and that appears to be...
2
by: walter | last post by:
Hi there, I know there is pool of HttpApplications, and for each request coming in, HttpRuntime will dedicate one from pool to serve the request. My questions are : 1. since HttpModule is plug...
1
by: Manso | last post by:
Hi, We want to create a generic request timer that will inject the time it took to render each page as a HttpModule. We want to be able to inject this just before the finishing </body> tag but I...
2
by: ChrisA | last post by:
Is there a way to inject a large javascript function into an asp.net page, in 1.1 and 2.0?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.