Aspx: by the server in the.Net compiler to interpret, translated into HTML, and then sent to the requester.
.ashx: by the server in the.Net compiler and is responsible for the interpretation, translation into the specified content, and then sent to the requester.
The difference between ASPX and ashx is that ASPX is a large container with life cycle (its interface properties), which includes the creation, initialization, loading, unloading and redraw, process (whether you use or not these processes). Ashx does not exist in the interface, compared with ASPX, occupy very little resources, too more flexible. So it is called: General.
Usually if necessary, we should use the ashx. for example, when you need to use ajax to call the server content, generally do not create.Aspx files to get content, and use the.Ashx file to access the content, to ensure that the resources consumed at least.