Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

httpHandlers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Manso - 02 Oct 2007 09:13 GMT
Hi,

We are doing custom request rewriting in a httpModule in
Application.AuthenticateRequest for requests coming in with .aspx using
HttpContext.RewritePath().

We are having a problem identifying requests that come in from registered
httpHandlers i.e. handlers with extension .aspx. These should just fall
through and not be analyzed/rewritten. Is there a way (flag?) that identifies
a request as a request to a handler? The Context.CurrentHandler is not yet
set this early.

We could always read the configuration data but since handlers can be added
further down in the config hierarchy we cannot cache it and it seems like a
costly operation.

Grateful for any ideas.

Thanks,
Manso
John Timney (MVP) - 02 Oct 2007 10:12 GMT
Might be one of those odd suggestions - but have you tried to just check the
request extension and drop through your handler if its missing or has an
.aspx extension?

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog

> Hi,
>
[quoted text clipped - 19 lines]
> Thanks,
> Manso
Manso - 02 Oct 2007 11:08 GMT
Hi John,

Thanks for your prompt reply.

We are only rewriting URLs with aspx extensions e.g.

www.site.com/products/category1/My-item1.aspx

will be rewritten as

www.site.com/products.aspx?item=My-item1&cat=category1

This means we have to react to all aspx-request. We check to see if the file
physically exists and skipped it if it did so existing pages (such as
product.aspx in the example above) would execute as normal.

Problem with HttpHandler is that they don't exist in the file system and in
our application we won't be able to tell whether it's a httpHandler or a
"normal" request that needs to be rewritten. We somehow need to be able to
identfy this as a call to a handler. Third party apps can register themselves
as handlers ("getfile.aspx", "makereservation.aspx" etc).

Thanks,
- Manso

> Might be one of those odd suggestions - but have you tried to just check the
> request extension and drop through your handler if its missing or has an
[quoted text clipped - 29 lines]
> > Thanks,
> > Manso
Kevin Spencer - 02 Oct 2007 11:51 GMT
Your custom HttpHandler should use a different file extension than "aspx."
It is the extension that identifies the handler to the web server.

Signature

HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

> Hi John,
>
[quoted text clipped - 61 lines]
>> > Thanks,
>> > Manso
Manso - 02 Oct 2007 12:09 GMT
Hi Kevin,

Thanks for your reply.

In theory - you're right. The problem is third party controls from e.g.
Telerik uses handlers for spellchecking, file upload etc and they're all
using extension aspx. This is natural as you need to change the mapping and
metadata in IIS to make it work otherwise which is a pain when deploying the
solution.

Any other ideas?

Thanks,
Manso

> Your custom HttpHandler should use a different file extension than "aspx."
> It is the extension that identifies the handler to the web server.
[quoted text clipped - 64 lines]
> >> > Thanks,
> >> > Manso
Kevin Spencer - 02 Oct 2007 18:24 GMT
The only thing I can think of is to set up a virtual directory that uses the
.aspx extension exclusively with your HttpHandler.

Signature

HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

> Hi Kevin,
>
[quoted text clipped - 91 lines]
>> >> > Thanks,
>> >> > Manso
Manso - 02 Oct 2007 19:09 GMT
Thanks, we ended up iterating through the configuration storage and caching
the httpHandlers with .aspx extension available for the application in a
string collection in the runtime cache. For each request we check against
that collection and ignores all request contained in the collection. Works
for now but is not bullet proof.

Thanks for your suggestions.

Manso

> The only thing I can think of is to set up a virtual directory that uses the
> ..aspx extension exclusively with your HttpHandler.
[quoted text clipped - 94 lines]
> >> >> > Thanks,
> >> >> > Manso

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.