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

HTTPHandler

I want to change the contents of a page using HTTPHandler. How can I get the
content of the page in ProcessRequest?

Thanks a lot!!
Nov 19 '05 #1
3 2386
you attach a response.filter to the binary stream, convert it to a string
using stringbuilder - manipulate it and convert it back to a binary stream.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"vibs" <vi**@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
I want to change the contents of a page using HTTPHandler. How can I get
the
content of the page in ProcessRequest?

Thanks a lot!!

Nov 19 '05 #2
Thanks John, I created a filter to change the contents of the page. Hwr when
I use the filter in the HTTPHandler, the page is blank.
Here is my code
public void ProcessRequest(System.Web.HttpContext context)
{
System.Web.HttpResponse objResponse = context.Response;
WebApplication2.ResponseFilter filter = new
WebApplication2.ResponseFilter(objResponse.Filter) ;
objResponse.Filter = filter;
}

"John Timney (ASP.NET MVP)" wrote:
you attach a response.filter to the binary stream, convert it to a string
using stringbuilder - manipulate it and convert it back to a binary stream.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"vibs" <vi**@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
I want to change the contents of a page using HTTPHandler. How can I get
the
content of the page in ProcessRequest?

Thanks a lot!!


Nov 19 '05 #3
Heres a very thorough explanation

http://www.devx.com/vb2themax/Article/19901/0/page/1

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"vibs" <vi**@discussions.microsoft.com> wrote in message
news:BC**********************************@microsof t.com...
Thanks John, I created a filter to change the contents of the page. Hwr
when
I use the filter in the HTTPHandler, the page is blank.
Here is my code
public void ProcessRequest(System.Web.HttpContext context)
{
System.Web.HttpResponse objResponse = context.Response;
WebApplication2.ResponseFilter filter = new
WebApplication2.ResponseFilter(objResponse.Filter) ;
objResponse.Filter = filter;
}

"John Timney (ASP.NET MVP)" wrote:
you attach a response.filter to the binary stream, convert it to a string
using stringbuilder - manipulate it and convert it back to a binary
stream.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"vibs" <vi**@discussions.microsoft.com> wrote in message
news:2F**********************************@microsof t.com...
>I want to change the contents of a page using HTTPHandler. How can I get
>the
> content of the page in ProcessRequest?
>
> Thanks a lot!!


Nov 19 '05 #4

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

Similar topics

2
by: Hanse Davion | last post by:
Can anyone provide some insight on what this problem could be? I have searched the web, read forums, and all the installation documentation for the dotnetnuke feeware portal from asp.net. I am...
3
by: Jed | last post by:
I have written an HttpHandler which I invoke through an ashx page. The HttpHandler does various things to process the request, then it is supposed to redirect to a confirmation page. Everything...
4
by: Jeremy Lew | last post by:
When my HttpHandler is processing a request when installed on a particular 2003 Server machine, the Context.Session object is null. Any idea why this might be? My handler implements...
3
by: Ralf Müller | last post by:
hi all! in my custom HttpHandler HttpContext.Current.Session is not set - why? greetings, ralf
9
by: Jared Tullis | last post by:
We have an .NET 1.1 application running on 4 2K3 load balanced servers (using WLBS). IIS has the .NET aspnet_isapi.dll mapped as a wildcard application map. The web.config points *.html to a...
7
by: Adam | last post by:
Im trying to add an httphandler for all *.sgf file extensions. I have developed the handler, 1. installed it into the gac 2. added it to the machine.config: <httpHandlers> <add verb="*"...
8
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really...
5
by: the4man | last post by:
Hi all! I have an app that show images that are stored in SQL Server. To show the images on screen, until now (with the "old" ASP), I use the following code: <img src="showimage.asp?id=20"...
5
by: zlf | last post by:
Hello, I try to use a custom HttpHandler to add something to session, then display the original page. public void ProcessRequest(HttpContext context) { context.Session = "test"; } But, a...
5
by: Author | last post by:
I followed the example at http://support.microsoft.com/kb/308001/EN-US/ and created my own HttpHandler. Here is the code: using System.Web; namespace MyNameSpace { public class...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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...

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.