Questions tagged [httphandler]

HttpHandlers are classes that implement the IHttpHandler and IHttpAsyncHandler interfaces. This section describes how to create and register HttpHandlers and provides examples of a synchronous handler, an asynchronous handler, and a handler factory.

ASP.NET Request Processing

Introduces ASP.NET handling of HTTP requests.

Creating HttpHandlers

Discusses the creation of synchronous and asynchronous HttpHandlers.

Registering HttpHandlers

Describes how ASP.NET is configured to call an HttpHandler.

HttpHandler Factory

Describes how to generate a new handler instance for each HTTP request.

Related Sections

HTTP Runtime Support

Provides an overview of how to use IHttpModule and IHttpHandler interfaces. 

HttpModules

Provides an overview of HttpModules. 
1249 questions
7
votes
3 answers

Analysing elmah logs

I am using elmah in some of my web application. I am wondering are there any reporting utilities or tools can analyse/scan all the logs and produce a report to show me the common errors in the log. I liked the one at…
Ajit Goel
  • 4,180
  • 7
  • 59
  • 107
7
votes
2 answers

File Upload using HTTPHandler

I am trying to upload file (multi part form data) using HTTPHandler. WebKit Boundary is getting written to the destination file, thus corrupting the file. Input files can be any kind of files, including text, zip, apk etc. Code: public void…
Piyp791
  • 649
  • 1
  • 13
  • 28
7
votes
2 answers

ASP.Net 4.0 - How to access RouteData from within an ASHX?

My web site has a handler (FileDownload.ashx) that deals with all file download requests. I've recently migrated my site to ASP.NET 4.0, and it now uses routing extensively. Everything works fine when dealing with page requests (aspx), but it's not…
Leigh Bowers
  • 707
  • 10
  • 22
7
votes
1 answer

Nested WebAPI issue with handler mappings (inheritance issue?)

I have a Asp.net WebAPI 2 (.net 4.5) site working in isolation on my local machine that I now want to ‘embed’ as a virtual application inside a web forms (.net 4.0) application. On the server, I have set up a new site and application pool and…
LDJ
  • 6,896
  • 9
  • 52
  • 87
7
votes
3 answers

HttpHandler fire only if file doesn't exist

I'm trying to create a HTTP handler to handle all requests to a folder but I only want it to fire if the files requested don't exist (EG: Request comes in for file X, if X exists I'd like to serve the file, otherwise the handler should deal with…
fyjham
  • 7,004
  • 2
  • 32
  • 40
7
votes
2 answers

Render ASPX page at runtime from database

Assuming the code below: public class DynamicAspxHandler : IHttpHandler { bool IHttpHandler.IsReusable { get { return false; } } void IHttpHandler.ProcessRequest(HttpContext httpContext) { string aspxContent = PlainASPXContent(); …
Dmytrii Nagirniak
  • 23,696
  • 13
  • 75
  • 130
7
votes
1 answer

HTTP Error 500.23 - Internal Server Error Local IIS Web server

I am trying to create my async HTTP handler on Visual Studio 2012. I have spent about 10 hours to find out why the server keeps giving me "HTTP Error 500.23 - Internal Server Error" response. Poor old me. And finally I found out that if I switch my…
Hoy Cheung
  • 1,552
  • 3
  • 19
  • 36
7
votes
5 answers

How do I get the MIME type of a file being requested in ASP.NET C#?

I would like to handle requests differently depending upon the MIME type. For example, I have PDF's, images and other media files that I would like to prohibit access to based on their respective MIME types. Any ideas on how to do this? Thanks for…
mkelley33
  • 5,323
  • 10
  • 47
  • 71
7
votes
2 answers

How can I use Session variable in an HttpHandler

Goal: I have a thumbnail as a byte array in memory. Once a user uploads their image, I want to display it in an httphandler before writing it to the database. I have used this code to successfully read it and display from a database. But now I want…
Jack
6
votes
2 answers

HTTP Handler works using Cassini, but not with IIS 6

I've created a sample project to simplify my problem. I have this simple handler: public class HandleThis : IHttpHandler, IRequiresSessionState { public void ProcessRequest( System.Web.HttpContext context ) { // Score.aspx just…
dudeNumber4
  • 4,217
  • 7
  • 40
  • 57
6
votes
2 answers

Blueimp jQuery File Upload and HttpHandler: No File and always "OPTIONS" HttpMethod

I'm struggeling getting the Blueimp jQuery File-Uploader working on MVC 3 with IIS 7.5 on Windows Server 2008 R2. I'm using an HttpHandler to handle the Upload, which get's called. But the HttpHandler never recieves a file nor the HttpMethod "POST"…
Phil
  • 568
  • 3
  • 19
6
votes
4 answers

"Content-encoding" header disappears from HttpHandler response if an exception occurs

I have a custom HttpHandler in which I manually enable output compression, like so: context.Response.AppendHeader("Content-encoding", "gzip"); context.Response.Filter = new GZipStream(context.Response.Filter, CompressionMode.Compress); This works…
David Mills
  • 2,385
  • 1
  • 22
  • 25
6
votes
2 answers

How to process long running requests with an HTTP handler under IIS?

I need to process long running requests inside IIS, handling the request itself is very lightweight but takes a lot of time mostly due to IO. Basically I need to query another server, which sometimes queries a third server. So I want to process as…
AK_
  • 7,981
  • 7
  • 46
  • 78
6
votes
1 answer

Evaluating ASPX Pages from custom httpHandlers

I have search everywhere for help and its starting to annoy me. I am creating an Internal Tooling Website which stores Tools and their related information. My vision is to have a web address (Http://website.local/Tool/ID) Where ID is the ID of the…
Oliver Baker
  • 253
  • 1
  • 2
  • 12
6
votes
1 answer

Collecting Stats on an asp.net mvc site?

Hi I need some advice. I need a way to keep track of user activity on my site, without third party tools (such as google anayltics). So basically any request that comes to my site I need to fire of an a async task that would collect info on the user…
usermon
  • 63
  • 4