How to continue request execution in a HttpHandler

O

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top