473,785 Members | 2,432 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 PageHandlerFact ory
object and get a IHttpHandler with the GetHandler method (I have
successfully done this in Sharepoint with SharepointHandl erFactory
object). The problem is that System.Web.UI.P ageHandlerFacto ry is marked
as internal (I think) and can't be instantiated from my handler. Then I
tried to create a new System.Web.UI.P age 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.respons e 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 4670
Hi Ori,

you need to call the Method "PageParser.Get CompiledPageIns tance" 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 PageHandlerFact ory
object and get a IHttpHandler with the GetHandler method (I have
successfully done this in Sharepoint with SharepointHandl erFactory
object). The problem is that System.Web.UI.P ageHandlerFacto ry is marked
as internal (I think) and can't be instantiated from my handler. Then I
tried to create a new System.Web.UI.P age 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.respons e 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
383
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 nothing more than wait 15 seconds before serving a page. (You can try it if you want. www.337skymaster.com/mypost.php) Using this page, we can open four IE browsers on the same machine and start each browser at the same time, and have all four...
5
2660
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 keep trying all sorts of namespaces, but to no avail. Keep getting: "The name 'Session' does not exist in the class or namespace 'xyz xyz xyz'" and "The type or namespace name 'Page' could not be found (are you missing a using directive or an...
10
4400
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); this.Controls.Add (control); // I change the content of the html of the control. TextReader reader = new StreamReader (path);
6
5587
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" alt="testing" /> So I created an HttpHanlder to handle PNG images, have mapped the PNG extension in the IIS and also added the HttpModule section in the web.config file.
2
3884
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 have a mapping of .* to the aspnet_isapi.dll. And my web.config has an entry thusly: <add verb="*" path="*" type="HandlerClass, HandlerAssembly" /> And this is working just fine thus far. The handler gets all the requests and works like a...
15
9167
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 GoTo GoTo nxt End If
2
6839
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 page sends a request to the factory which then instantiates an instance of the handler. The response is read by a third party component that then displays the image. i.e. inside .aspx page:
0
1760
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 page sends a request to the factory which then instantiates an instance of the handler. The response is read by a third party component that then displays the image. i.e. inside .aspx page: -------------------------
2
4185
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 data, the result of which does not affect the response, hence why i don't want to waste time leaving the connection open or keeping the client waiting, I suppose you could call the client request a "trigger". I do not mind using ASP functions...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.