472,976 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,976 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 4553
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.