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? 4 1260
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.r illing.net> wrote in message
news:eD******** ******@tk2msftn gp13.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?
This sounds like you want an HttpModule, not an HttpHandler.
--
John Saunders
Internet Engineer jo***********@s urfcontrol.com
"Peter Rilling" <pe***@nospam.r illing.net> wrote in message
news:eD******** ******@tk2msftn gp13.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?
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******** ******@TK2MSFTN GP12.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.r illing.net> wrote in message news:eD******** ******@tk2msftn gp13.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?
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.r illing.net> wrote in message
news:eD******** ******@tk2msftn gp13.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?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 World!");
}
public bool IsReusable {
|
by: Daniel Danilin |
last post by:
How can I add/remove an HttpHandler in code (not in web.config)?
|
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 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...
|
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 additional code specific to the .mspx
extension files.
I thought this would be an easy task, but maby I've cornored myself into a
wrong path. I've set the mapping correct in IIS, so that asp.net manages the
new extension. I've also created a...
|
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 MyHttpHandler, the namespace lessius.
in the web.config, I've got a configuration error:
| |
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
an error telling me it's not a legal xml file.
Any ideas?
--
|
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" type="MyNM.SiteMap, MyNM" />
</httpHandlers>
|
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";
context.Response.Write("Text file handler");
|
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 reference any image in HTML using the following syntax:
<img src="http://mydomain.com/images/1234.img?size=thumbnail" />
Every piece of that web site works fine.
Now I'm creating a second web site located on a different server. When I use the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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...
|
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...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |