468,249 Members | 1,513 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

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 4221
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by TomR | last post: by
2 posts views Thread by deepak.bhardwaj | last post: by
reply views Thread by superman | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.