Questions tagged [ihttphandler]

Defines an endpoint in the ASP.NET pipeline for processing a request.

http://msdn.microsoft.com/en-us/library/system.web.ihttphandler(v=vs.100).aspx

All requests in the ASP.NET pipeline must eventually be handled by a class implementing the IHttpHandler interface. The handler is defined in either the system level web.config and can be overridden and website and subsite levels through the configuration inheritence chain.

The handler is usually mapped to one or more extensions (.aspx, .axd, .ascx, etc) may all be handled by Page Handler.

More details and explanation of how this interacts with the ASP.NET Request/Response pipeline may be found here.

244 questions
4
votes
3 answers

How can I redirect maintenance site in asp.net

We have a ASP.NET website in .NET which is running successfully in production. we have frequently maintain our server on a particular downtime. Hence, We need a feature to redirect all request to Site Under maintenance web page at downtime. I've…
Smaug
  • 2,625
  • 5
  • 28
  • 44
3
votes
2 answers

Efficient forwarding HTTP requests with an IHttpAsyncHandler

I'm developing a HTTP front controller, based on the pattern of Martin Fowler (link). In my case the controller has the following responsibilities: - Unmarshall encapsulated data - Authorize the request - Logging - Relay / forward the request to…
Niels Bergsma
  • 77
  • 1
  • 7
3
votes
2 answers

HttpHandler instance and HttpApplication object - does the latter...?

A Book showed an example where ( when using IIS7 ) the following module was configured such that it would be used by any web application ( even by non-asp.net apps ) running on a web site. But: if this module is invoked for non-asp.net application,…
SourceC
  • 3,829
  • 8
  • 50
  • 75
3
votes
2 answers

Unbuffered output from IHTTPHandler

I want to stream data from an IHttpHandler class. I'm loading a large number of rows from the DB, serializing, and compressing them, then sending them down the wire. On the other end, I want my client to be able decompress, and deserialize the data…
Timothy Baldridge
  • 10,455
  • 1
  • 44
  • 80
3
votes
1 answer

Properly respond to a HEAD request

I have an IHttpHandler serving dynamically generated files. I wish to respond to HEAD requests to let the client know whether the file has changed. I need to send the last change date and the file size, do I have to use Response.AddHeader() or is…
Mart
  • 5,608
  • 3
  • 32
  • 45
3
votes
3 answers

How to catch a specific HttpException (#0x80072746) in an IHttpHandler

It appears that this HttpException (0x80072746 - The remote host closed the connection) can be thrown if, for example, the user closes the window whilst we are transmitting a file. Even if we send the files in smaller blocks and check the client is…
grebe
  • 31
  • 1
  • 2
3
votes
0 answers

How do I get a IHttpHandler to do authentication properly?

I have some IHttpHandler implementations where they may optionally have authentication applied to them. I originally rolled my own Basic authentication but would now like to use IIS's capabilities so that the deploying user can control what type of…
RobV
  • 28,022
  • 11
  • 77
  • 119
3
votes
1 answer

"Invalid use of response filter" when compressing response from an IHttpHandler

I have an IHttpHandler returning a file. When the response stream is compressed, either automatically using Telerik RadCompression or by explicitly setting a filter using context.Response.Filter = new GZipStream(context.Response.Filter,…
mhenry1384
  • 7,538
  • 5
  • 55
  • 74
3
votes
3 answers

Log file is not being written to from an HttpHandler

I want to capture all the requests going to *.jpg files on my server. To do so, I have created an HttpHandler whose code is as follows: using System; using System.Collections.Generic; using System.Text; using System.Web; using System.IO; using…
Badmate
3
votes
3 answers

Why is this class library dll not getting information from app.config

I am developing a custom HttpHandler, to do so I write a C# Class Library and compile to DLL. As part of this I have some directory locations which I want not hard coded in the app, so i'm trying to put it in the app.config which I've used…
baron
  • 11,011
  • 20
  • 54
  • 88
3
votes
0 answers

IHTTPHandler on Web Api

I try to use an existing IHttpHandler on an ASP.NET MVC\WEB API website, deployed on a VS IIS EXPRESS 8.0 and on a production IIS 7.5 It basically looks like public class MP4DownloadHandler : IHttpHandler { ... public void…
alex440
  • 1,647
  • 3
  • 20
  • 35
3
votes
1 answer

Why is IHttpAsyncHandler being called over IHttpHandler?

I made a custom handler that derives from MvcHandler. I have my routes using a custom RouteHandler that returns my new handler for GetHttpHandler(), and I override ProcessRequest() in my custom handler. The call to GetHttpHandler is triggering a…
Tim Hardy
  • 1,654
  • 1
  • 17
  • 36
3
votes
1 answer

Execute IHttpHandler to MemoryStream

I am wanting to use something like HttpServerUtility.Execute to execute an IHttpHandler and write the handler response to a MemoryStream that can then be parsed into an http response (functionally, I want access to the headers and the content…
Neaox
  • 1,933
  • 3
  • 18
  • 29
2
votes
2 answers

Centralized image server with security and water mark on it

I have a situation where I have to make a centralized image website. I want to secure those images from direct access. I want to send response with a watermark over it depending on request parameter. What is the best approach for it. So far I have…
शेखर
  • 17,412
  • 13
  • 61
  • 117
2
votes
1 answer

IRequiresSessionState does not work

I have been struggling with this a while now. I implemented a basic IHttpHandler with the following code and SESSION keeps being newed up: namespace ClassLibrary1 { public class MyHandler : IHttpHandler, IRequiresSessionState { …
q10
  • 33
  • 3
1 2
3
16 17