Questions tagged [ashx]

ASP.NET Web Handler file extension

Just as ASPX files can be compiled on the fly (just-in-time), so can handlers. Generic handlers have an extension of ASHX. They're equivalent to custom handlers written in C Sharp or Visual Basic.NET in that they contain classes that fully implement IHttpHandler. They're convenient in the same way ASPX files are convenient. You simply surf to them and they're compiled automatically.

Reference

ASHX usage example

Creating a Synchronous HTTP Handler on MSDN

Creating an Asynchronous HTTP Handler on MSDN

HTTP Handlers and HTTP Modules Overview

Significance of bool IsReusable in http handler interface

610 questions
115
votes
4 answers

.aspx vs .ashx MAIN difference

What are the differences between .aspx and .ashx pages? I use ashx now when I need to handle a request that was called from code and returned with a response, but I would like a more technical answer please.
Arrabi
  • 3,592
  • 4
  • 23
  • 38
44
votes
8 answers

ASP.NET - Passing JSON from jQuery to ASHX

I'm trying to pass JSON from jQuery to a .ASHX file. Example of the jQuery below: $.ajax({ type: "POST", url: "/test.ashx", data: "{'file':'dave', 'type':'ward'}", contentType: "application/json; charset=utf-8", …
colin jobes
  • 441
  • 1
  • 5
  • 3
27
votes
2 answers

What are .ashx files in an ASP.NET application?

When do you use ashx files in asp.net web application ? Can some one explain in simple terminology with a pratical example ? I understood from the msdn that .ashx files implements ihttphandler but i could not get much explanation from here…
Sree
  • 6,255
  • 19
  • 64
  • 104
26
votes
5 answers

How to use output caching on .ashx handler

How can I use output caching with a .ashx handler? In this case I'm doing some heavy image processing and would like the handler to be cached for a minute or so. Also, does anyone have any recommendations on how to prevent dogpiling?
Kieran Benton
  • 8,177
  • 11
  • 50
  • 74
23
votes
2 answers

How to use Generic Handlers (ASHX) in ASP.NET MVC?

I need a image generator in my ASP.NET MVC application, but I don't know if it is possible to use ASHX in ASP.NET MVC. If there is an class similar to IHttpHandler that inherits IViewDataContainer, then I could use ViewData.Model on my ASHX. I read…
Jader Dias
  • 81,082
  • 147
  • 410
  • 611
18
votes
3 answers

PDF Handler : content-disposition filename

I am outputting a PDF file in a Web browser (IE8) HttpContext.Response.writefile(fileName) and it works great. When I try to save the file, it will give me the name of the ashx handler as a default. I would like to actually pass the real name. I…
user2062308
  • 183
  • 1
  • 1
  • 5
15
votes
4 answers

Visual Studio ASP.Net expand and collapse issue in ashx generic handlers

I have Visual Studio 2008 Professional and I am having issues with expanding and collapsing method code blocks in ASP.Net Generic Handler pages (.ashx) I would have thought you could do the same thing like in the code behind of .aspx web pages. I…
410
  • 3,090
  • 8
  • 30
  • 36
15
votes
3 answers

response redirect from .ashx file

I have ashx file and I want to redirect from ashx to aspx page. Some solution?
Ballon
  • 5,986
  • 18
  • 45
  • 60
14
votes
4 answers

What are the benefits of an ASHX handler file in asp.net?

What are the benefits of using an ashx, or handler? Also, do I need them if I use MVC (and why not)? Does the framework matter (2.0+)? Why would I want to use a handler? I was recently recommended to use one for retrieving an image but I don't know…
johnny
  • 18,093
  • 48
  • 144
  • 235
12
votes
2 answers

making asynchronous calls from generic handler (.ashx)

I have a form in my website which posts json to the async handler which validates the data and return back the resonse OK or error and i will make the redirect on the client based on the response give by my handler. But when the response is ok, i…
sbmandav
  • 1,181
  • 2
  • 12
  • 25
12
votes
1 answer

How to get the QueryString from an ashx file?

There is an ashx file containing "ProcessRequest(HttpContext context)" method which gets triggered automatically. When and how does it get fired? Another question, How can I get the current QueryString when I am inside this file? When I type…
Ahmad Farid
  • 13,132
  • 45
  • 92
  • 134
12
votes
2 answers

.ashx file in asp.net?

What is an .ashx file in asp.net?
Domnic
  • 3,397
  • 9
  • 32
  • 59
10
votes
5 answers

Only count a download once it's served

We have this code which serves a download: public class downloadRelease : IHttpHandler { public void ProcessRequest (HttpContext context) { -- snip -- context.Response.Clear(); context.Response.ContentType =…
Tom Gullen
  • 56,187
  • 79
  • 269
  • 433
10
votes
2 answers

Supporting resumable HTTP-downloads through an ASHX handler?

We are providing downloads of our application setups through an ASHX handler in ASP.NET. A customer told us he uses some third party download manager application and that our way of providing the files currently does not support the "resume" feature…
Uwe Keim
  • 36,867
  • 50
  • 163
  • 268
10
votes
2 answers

how to call ASHX handler and getting the result back

I have created a Handler which return integer value after doing some database work. i would like to know how can i get that value and assign that value to Label by calling that handler. I have googled it and most of the example uses Jquery.AJAX…
patel.milanb
  • 5,450
  • 14
  • 52
  • 86
1
2 3
40 41