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
153
votes
8 answers

HTTP handler vs HTTP module

Can someone explain in less than 2 sentences the difference between both? Yes, I know google can provide hundreds of answers but not one in 2 clear sentences:)
frenchie
  • 51,731
  • 109
  • 304
  • 510
133
votes
3 answers

Significance of bool IsReusable in http handler interface

When writing a http handler/module, there is an interface member to implement called - bool IsReusable. What is the significance of this member? If I set it to false (or true), what does this mean for the rest of the web app?
GurdeepS
  • 65,107
  • 109
  • 251
  • 387
84
votes
5 answers

IHttpHandler vs IHttpModule

My question is simple (although the answer will most likely not be): I'm trying to decide how to implement a server side upload handler in C# / ASP.NET. I've used both HttpModules (IHttpModule interface) and HttpHandlers (IHttpHandler interface)…
Dan Esparza
  • 28,047
  • 29
  • 99
  • 127
68
votes
6 answers

What is an HttpHandler in ASP.NET

What is an HttpHandler in ASP.NET? Why and how is it used?
Nikola Stjelja
  • 3,659
  • 9
  • 37
  • 45
65
votes
4 answers

How to use ASP.NET Session State in an HttpHandler?

I have an HttpHandler that is run on a client page (cross domain, not on our IIS server, etc) and when they click on our embedded link it fires off the Handler on our server. So far everything is working normally. I am now trying to use the…
Keith Barrows
  • 24,802
  • 26
  • 88
  • 134
52
votes
3 answers

Leverage browser caching in IIS (google pagespeed issue)

There are several questions about leveraging browser caching but I didn't find anything useful for how to do this in an ASP.NET application. Google's Pagespeed tells this is performance biggest problem. So far I did this in my…
Vlado Pandžić
  • 4,879
  • 8
  • 44
  • 75
42
votes
3 answers

URL Routing, Image Handler & "A potentially dangerous Request.Path value"

I've been experiencing this problem now for quite sometime and have decided to try and get to the bottom of it once and for all by posting the question here for some thought. I have an image handler in a .net 4 website located here:…
James
  • 926
  • 1
  • 8
  • 24
39
votes
2 answers

using Plupload with ASP.NET/C#

UPDATE I was able to get everything to work properly and I just wanted to post back with the updated code. I used Darin Dimitrov's suggestion on using a separate generic http handler for handling the file uploads and so this is the code I came up…
Hristo
  • 45,559
  • 65
  • 163
  • 230
36
votes
2 answers

Difference between Stream.CopyTo and MemoryStream.WriteTo

I have a HttpHandler returning an image through Response.OutputStream. I have the following code: _imageProvider.GetImage().CopyTo(context.Response.OutputStream); GetImage() method returns a Stream which is actually a MemoryStream instance and it…
jorgehmv
  • 3,633
  • 3
  • 25
  • 39
35
votes
9 answers

Problem mapping HttpHandler --> HTTP Error 404 Not Found

I am having problems trying to map an HttpHandler in the web.config. This is the relevant config bit: When I navigate to…
JohnIdol
  • 48,899
  • 61
  • 158
  • 242
33
votes
2 answers

Asp.Net Session is null in ashx file

I am trying to access the Session variable in Asp.Net ashx handler as shown below. public void ProcessRequest (HttpContext context) { context.Session["VariableName"] = Id; } But the context.Session is always Null inside the above…
Amitabh
  • 59,111
  • 42
  • 110
  • 159
29
votes
2 answers

How do I register multiple paths for a HttpHandler in IIS7?

I have a HttpHandler that resizes images based on the querystring, so requesting something like: http://server/image.jpg?width=320&height=240 will give you a resized image that's 320x240. In the IIS Manager, under Handler Mappings, I mapped my…
Daniel T.
  • 37,212
  • 36
  • 139
  • 206
27
votes
2 answers

Performance difference between Synchronous HTTP Handler and Asynchronous HTTP Handler

Is there a performance difference between Synchronous HTTP Handler and Asynchronous HTTP Handler? IHttpHandler vs IHttpAsyncHandler Why choose one over another? What are the benefits?
DarthVader
  • 52,984
  • 76
  • 209
  • 300
27
votes
2 answers

What's the difference between HttpMethod and RequestType of HttpRequest?

The HttpRequest class defines two properties: HttpMethod: Gets the HTTP data transfer method (such as GET, POST, or HEAD) used by the client. public string HttpMethod { get; } The HTTP data transfer method used by the client. and…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
27
votes
1 answer

IIS7, web.config to allow only static file handler in directory /uploads of website

If it's possible which I think so, How do I modify my web.config to make a sub directory static -- files inside will only processed as static file, even if its name is "aspx" or something else? Thanks.
deerchao
  • 10,454
  • 9
  • 55
  • 60
1
2 3
83 84