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

How to continue request execution in a HttpHandler

ori
Hi,

I'm facing a problem when trying to continue normal execution flow
within a HttpHandler ProcessRequest method. In my application we
currently have a custom HttpHandler registered which validates a user
against some Authentication method and then allows him to continue his
request if successfully authenticated or denies him access if not. We
use a handler to do this authentication and we'd like to continue
normal execution if successfully authenticated.

As I understand, we should instantiate somehow a PageHandlerFactory
object and get a IHttpHandler with the GetHandler method (I have
successfully done this in Sharepoint with SharepointHandlerFactory
object). The problem is that System.Web.UI.PageHandlerFactory is marked
as internal (I think) and can't be instantiated from my handler. Then I
tried to create a new System.Web.UI.Page object (which, according to
msdn implements IHttpHandler interface) and invoked it's
ProcessContext() method (at first this method doesn't appear with
intelisense context help but you can write it and it compiles without
problem :S) However, this didn't work and the context.response didn't
get processed.

I'd like to know how we can continue the execution flow to a normal
aspx from our custom Handler, how to successfully instantiate a
PageHandler and invoke it's ProcessRequest method from my Handler (as I
said, I successfully did this in Sharepoint). I know there might be
better ways to authenticate users (I'm not asking this) I'd only know
if it is possible to achieve this behaviour with HttpHandlers by
letting the request flow between them.

Thanks in advance,
ori

Nov 19 '05 #1
1 4599
Hi Ori,

you need to call the Method "PageParser.GetCompiledPageInstance" in
System.Web.UI namespace. You need to provide the physical and virtual path
to the *.aspx File you want to be compiled.

Hope that helps
Patrick

"ori" wrote:
Hi,

I'm facing a problem when trying to continue normal execution flow
within a HttpHandler ProcessRequest method. In my application we
currently have a custom HttpHandler registered which validates a user
against some Authentication method and then allows him to continue his
request if successfully authenticated or denies him access if not. We
use a handler to do this authentication and we'd like to continue
normal execution if successfully authenticated.

As I understand, we should instantiate somehow a PageHandlerFactory
object and get a IHttpHandler with the GetHandler method (I have
successfully done this in Sharepoint with SharepointHandlerFactory
object). The problem is that System.Web.UI.PageHandlerFactory is marked
as internal (I think) and can't be instantiated from my handler. Then I
tried to create a new System.Web.UI.Page object (which, according to
msdn implements IHttpHandler interface) and invoked it's
ProcessContext() method (at first this method doesn't appear with
intelisense context help but you can write it and it compiles without
problem :S) However, this didn't work and the context.response didn't
get processed.

I'd like to know how we can continue the execution flow to a normal
aspx from our custom Handler, how to successfully instantiate a
PageHandler and invoke it's ProcessRequest method from my Handler (as I
said, I successfully did this in Sharepoint). I know there might be
better ways to authenticate users (I'm not asking this) I'd only know
if it is possible to achieve this behaviour with HttpHandlers by
letting the request flow between them.

Thanks in advance,
ori

Nov 19 '05 #2

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

Similar topics

5
by: TomR | last post by:
We are having problems with synchronus web request calls blocking our ASP.NET performance. Here is the setup: We have a php script running on Apache at Site A on the internet. This script does...
5
by: Filip | last post by:
Hello, (ASP.NET c#) I want to put some common functions into one class and within this class I need to have access to the Session, Request and Response. This class is not page behind file! I...
10
by: Umut Tezduyar | last post by:
It seems, it is caching it. The following code is an example for it. How can avoid from this. override void OnLoad (sender and eventargs) { Control control = this.LoadControl (path);...
6
by: David Bowey | last post by:
Hi There! I'm writing a custom HttpHandler to create watermarks on my PNG images of my website. So typically, a PNG image is linked in an ASPX page as follows... <img src="images/test.png"...
2
by: Seth | last post by:
Ok, here is my setup. I have a fully functioning HTTP Handler implemented. The handler is supposed to handle every single request that comes in to a particular virtual directory. Thus, in IIS, I...
15
by: PagCal | last post by:
Is this language missing the functionality of a C/C++ 'continue' statement? For example: While NOT isEof() If condition ' a C or C++ continue would work here ' but we are forced to use a...
2
by: deepak.bhardwaj | last post by:
Hi, I have implemented the IHttpHandler interface for generating images and writing them to response stream in binary format. I use an IHttpHandlerFactory to instantiate that handler. A .aspx...
0
by: superman | last post by:
Hi, I have implemented the IHttpHandler interface for generating images and writing them to response stream in binary format. I use an IHttpHandlerFactory to instantiate that handler. A .aspx...
2
by: boole | last post by:
Hi there, when my ASP page receives the client request, I want to gather the request data (form), promptly end the response to the client (successful) and continue doing what I need to do with the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.