473,387 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

What happens if more than one HttpHandler is registered for a file type?

Okay, I need to create an HttpHandler that will process all requests to the
server so that I can perform special logging. What happens if there are
more than one handler registered with the same file extension? For
instance, someone accesses a .aspx page. Normally that would only be
handled by normal handler. What I want to do is register a handler for this
extension, but also allow the normal handler to process it after I am done.
I won't be writing anything to the response stream, I just want code to run
on each request. Will this cause problem?
Nov 17 '05 #1
4 1242
Why don't you just create an inherited Page class that does your task with
each Request, and then inherit that for all of your Pages?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:eD**************@tk2msftngp13.phx.gbl...
Okay, I need to create an HttpHandler that will process all requests to the server so that I can perform special logging. What happens if there are
more than one handler registered with the same file extension? For
instance, someone accesses a .aspx page. Normally that would only be
handled by normal handler. What I want to do is register a handler for this extension, but also allow the normal handler to process it after I am done. I won't be writing anything to the response stream, I just want code to run on each request. Will this cause problem?

Nov 17 '05 #2
This sounds like you want an HttpModule, not an HttpHandler.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:eD**************@tk2msftngp13.phx.gbl...
Okay, I need to create an HttpHandler that will process all requests to the server so that I can perform special logging. What happens if there are
more than one handler registered with the same file extension? For
instance, someone accesses a .aspx page. Normally that would only be
handled by normal handler. What I want to do is register a handler for this extension, but also allow the normal handler to process it after I am done. I won't be writing anything to the response stream, I just want code to run on each request. Will this cause problem?

Nov 17 '05 #3
Because my team does not control the pages or any of the site content for
that matter. Also, I need to perform special logging for static content as
well (e.g. gif, jpg, css, etc.)
"Kevin Spencer" <ke***@takempis.com> wrote in message
news:#I**************@TK2MSFTNGP12.phx.gbl...
Why don't you just create an inherited Page class that does your task with
each Request, and then inherit that for all of your Pages?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:eD**************@tk2msftngp13.phx.gbl...
Okay, I need to create an HttpHandler that will process all requests to

the
server so that I can perform special logging. What happens if there are
more than one handler registered with the same file extension? For
instance, someone accesses a .aspx page. Normally that would only be
handled by normal handler. What I want to do is register a handler for

this
extension, but also allow the normal handler to process it after I am

done.
I won't be writing anything to the response stream, I just want code to

run
on each request. Will this cause problem?


Nov 17 '05 #4
Two additional points.
1) I need to be able to trap requests for all file types, including ASP,
GIF, CSS, etc.
2) I need to be able to access the user's authenticated identity for that
page request.

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:eD**************@tk2msftngp13.phx.gbl...
Okay, I need to create an HttpHandler that will process all requests to the server so that I can perform special logging. What happens if there are
more than one handler registered with the same file extension? For
instance, someone accesses a .aspx page. Normally that would only be
handled by normal handler. What I want to do is register a handler for this extension, but also allow the normal handler to process it after I am done. I won't be writing anything to the response stream, I just want code to run on each request. Will this cause problem?

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lloyd Dupont | last post by:
I have a simple HttpHandler //-- using System.Web; namespace Acme { public class SimpleHandler : IHttpHandler { public void ProcessRequest(HttpContext context) { context.Response.Write("Hello...
10
by: Daniel Danilin | last post by:
How can I add/remove an HttpHandler in code (not in web.config)?
1
by: ori | last post by:
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...
4
by: Paul | last post by:
Hi! I want my web application to be able to handle files with the extension ..mspx (my own extension). The new extension should be handled exatly the way aspx files are handled, but with some...
0
by: Filip De Backer | last post by:
Hi everyone, I've registered an HttpHandler class, just like it is described on http://msdn2.microsoft.com/en-us/library/46c5ddfy I've put the class in the App_code folder The class name is...
5
by: David Thielen | last post by:
Hi; I am writing the output of a page directly using IHttpHandler, IRequireSessionState and if it is a text file I set HttpContext.Response.ContentType = "text/plain". But when it displays I get...
1
by: shapper | last post by:
Hello, I created an HttpHandler class, compiled it and tested it. It works fine. I added an HttpHandler in my web.config file as follows: <httpHandlers> <add verb = "*" path="MyHandler"...
2
by: Ilyas | last post by:
Hi all I have a simple httphandler : public class TextFileHandler : IHttpHandler { public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain";...
1
by: latortugamorada | last post by:
I have some images which are served using an HttpHandler for several reasons. I've registered the .img extension with ASP.NET and added an <ADD> directive in the web.config file so that I can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.