Search:
Namespaces
Discussions
.NET v1.1
Feedback
how to invoke PageHandlerFactory from an HttpHandler?
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspnghttphandlers' list
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Stuart C. Salsbury
PageHandlerFactory does not have a public constructor and it's killing me.
In IIS config, I have redirected all requests (extension = *) to the .net
framework. I have an HttpHandler set to handle all such requests. Now I
want that handler to do some thinking, then assign the processing to an
.aspx page.
I know how to assign the processing to a code-only page (just call
ProcessRequest from the
IHttpHandler
interface). However, since
PageHandlerFactory isn't creatable I don't know how to transfer processing
to .aspx files.
Can anyone help me out?
Thanks,
Stuart Salsbury
Ernst & Young LLP
Reply to this message...
Mitch Denny (VIP)
Stuart,
You could possibly inherit from the PageHandlerFactory class
and do the customisation that way, but the information you
have provided doesn't seem to make the solution clear.
Optimally you could implement this in a class that implements
the
IHttpModule
interface, you could then attach event handlers
from the
HttpContext
within the Init(...) method.
Can you give us a non-technical run down of what you do then
a better solution might present it self.
----------------------------------------
- Mitch Denny
-
http://www.warbyte.com
-
Click here to reveal e-mail address
- +61 (414) 610-141
-
[Original message clipped]
Reply to this message...
Stuart C. Salsbury
Mitch,
Thanks for your response. The solution that I've just found (while trying
to write to you to clarify my problem) is to implement an
IHttpHandlerFactory
that alters the path parameter that it is given prior to
invoking a
PageParser
.GetCompiledPageInstance method.
public
IHttpHandler
GetHandler(
HttpContext
context, string requestType,
string url, string pathTranslated)
{
context.Trace.IsEnabled = true;
return
PageParser
.GetCompiledPageInstance("the url and requestType don't
seem to matter to the
PageParser
... see trace for proof",
@"c:\inetpub\wwwroot\testsite\default.aspx", context);
}
Mitch, thanks you for prodding me to be more specific... it helped. If
anyone knows that the url and requestType are valued by the
PageParser
and
the resulting Page, please let me know.
Thanks,
Stuart
P.S. I've seen people bumming around for ways to directly incorporate aspx
and ascx files from other web apps / servers... I wonder if the
PageParser
would allow this?
-----Original Message-----
From: Mitch Denny [mailto:
Click here to reveal e-mail address
]
Sent: Monday, June 25, 2001 10:23 PM
To: aspnghttphandlers
Subject: [aspnghttphandlers] RE: how to invoke PageHandlerFactory from an
HttpHandler?
Stuart,
You could possibly inherit from the PageHandlerFactory class
and do the customisation that way, but the information you
have provided doesn't seem to make the solution clear.
Optimally you could implement this in a class that implements
the
IHttpModule
interface, you could then attach event handlers
from the
HttpContext
within the Init(...) method.
Can you give us a non-technical run down of what you do then
a better solution might present it self.
----------------------------------------
- Mitch Denny
-
http://www.warbyte.com
-
Click here to reveal e-mail address
- +61 (414) 610-141
-
[Original message clipped]
| [aspnghttphandlers] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.asplists.com/asplists/aspnghttphandlers.asp
= JOIN/QUIT
|
http://www.asplists.com/search
= SEARCH Archives
Reply to this message...
Mitch Denny (VIP)
Stuart,
I think the URL parameter on the GetHandler method is
just for reference. I can't think of a reason why it is
useful, because the RawUrl property provides that information
in the
HttpRequest
property of the
HttpContext
. Unless ofcourse
the string provided in the call primes that actual value.
Perhaps someone from Microsoft might be able to explain that
one. Scott, Susan?
----------------------------------------
- Mitch Denny
-
http://www.warbyte.com
-
Click here to reveal e-mail address
- +61 (414) 610-141
-
[Original message clipped]
Reply to this message...
Ihor Bobak
class MyOwnPageHandlerFactory : IHttpHandlerFactory
{
public virtual
IHttpHandler
GetHandler (
HttpContext
context, string requestType, string url, string path)
{
return
PageParser
.GetCompiledPageInstance (url, path, context);
}
public virtual void ReleaseHandler (
IHttpHandler
handler)
{
}
}
Reply to this message...
System.Web.HttpContext
System.Web.HttpRequest
System.Web.IHttpHandler
System.Web.IHttpHandlerFactory
System.Web.IHttpModule
System.Web.UI.PageParser
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com