.ashx files are web-handler files in asp.net programming and define IHttpHandler interface. Whenever an .ashx file is requested, ProcessRequest() method is invoked automatically. ProcessRequest() is a method where we do make changes according to our requirement.
Handlers are used in URL routing, Image handling, binary data handling etc. as it support backward compatibility.