An ASP.NET HTTP handler is a process that runs in response to a request made to an ASP.NET Web application. [1] The most common handler is the ASP.NET page handler that processes .aspx files. When users request an .aspx file, the request is processed by the page through the page handler. [2]
HTTP handlers are an essential component of the ASP.NET framework, providing a low-level way to interact with incoming HTTP requests. They offer developers fine-grained control over how specific requests are processed, allowing for custom handling of various file types or URL patterns. [3]
HTTP handlers were not present in the "Classic" ASP. They implement the System.Web.IHttpHandler
interface. Unlike ASP.NET Web Forms, they have no HTML-markup file, no events and other supporting. All they have is a code-file (written in any .NET-compatible language) that writes some data to the server HTTP response. HTTP handlers are similar to ISAPI extensions. [4]
The IHttpHandler
interface defines two key members: 1.IsReusable
: A boolean property indicating whether the handler can be reused for multiple requests. 2.ProcessRequest
: A method that contains the actual request processing logic. [5]
Developers can create custom HTTP handlers to implement specialized functionality, such as: 1. Generating dynamic images or documents on-the-fly. 2. Implementing custom authentication or authorization schemes. 3. Handling specific file types or URL patterns in a unique way. 4. Creating RESTful web services. [6] [7]
An HTTP module is an assembly that is called on every request that is made to your application. HTTP modules are called as part of the ASP.NET request pipeline and have access to life-cycle events throughout the request. HTTP modules let you examine incoming and outgoing requests and take action based on the request. [8]
While HTTP handlers are responsible for generating the response to a specific request, HTTP modules can intercept and process all requests that pass through the ASP.NET pipeline. This makes modules ideal for implementing cross-cutting concerns such as logging, security, or performance monitoring. [9]
Unlike ASP.NET Web Forms, that have ".aspx" file extension, ASP.NET handlers by default have ".ashx" file extension. [10]
Handlers are considered to be more lightweight object than ASP.NET Web Forms. That is why they are used to serve dynamically-generated images, on-the-fly generated PDF-files and similar content to the web browser. [11]
To configure an HTTP handler in an ASP.NET application, developers can use the <httpHandlers>
section in the web.config file. This allows for mapping specific file extensions or URL patterns to custom handler classes. [12]
With ASP.NET Core, this HTTP handlers have been replaced with "middleware" ApplicationBuilders (IApplicationBuilder) which allow routing requests based on request headers instead of just the URL path. [13]
The transition to middleware in ASP.NET Core represents a significant shift in the request processing model. Middleware components are more flexible and can be easily chained together to form a request processing pipeline. This new approach offers several advantages: 1. Greater modularity and reusability of request processing components. 2. Simplified configuration and setup compared to the handler/module system. 3. Improved performance due to reduced overhead in request processing. 4. Better support for asynchronous processing and modern programming patterns. [14]
Despite these changes, the core concepts behind HTTP handlers remain relevant in understanding how web applications process and respond to HTTP requests, making them an important topic for ASP.NET developers to study. [15]
Active Server Pages (ASP) is Microsoft's first server-side scripting language and engine for dynamic web pages.
Server-side scripting is a technique used in web development which involves employing scripts on a web server which produces a response customized for each user's (client's) request to the website. Scripts can be written in any of a number of server-side scripting languages that are available. Server-side scripting is distinguished from client-side scripting where embedded scripts, such as JavaScript, are run client-side in a web browser, but both techniques are often used together. The alternative to either or both types of scripting is for the web server itself to deliver a static web page.
VBScript is a deprecated programming language for scripting on Microsoft Windows using Component Object Model (COM) based on classic Visual Basic and Active Scripting.
Microsoft IIS is an extensible web server created by Microsoft for use with the Windows NT family. IIS supports HTTP, HTTP/2, HTTP/3, HTTPS, FTP, FTPS, SMTP and NNTP. It has been an integral part of the Windows NT family since Windows NT 4.0, though it may be absent from some editions, and is not active by default. A dedicated suite of software called SEO Toolkit is included in the latest version of the manager. This suite has several tools for SEO with features for metatag / web coding optimization, sitemaps / robots.txt configuration, website analysis, crawler setting, SSL server-side configuration and more.
Extensible Application Markup Language is a declarative XML-based language developed by Microsoft for initializing structured values and objects. It is available under Microsoft's Open Specification Promise.
ASP.NET is a server-side web-application framework designed for web development to produce dynamic web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, applications and services. The name stands for Active Server Pages Network Enabled Technologies.
Windows Installer is a software component and application programming interface (API) of Microsoft Windows used for the installation, maintenance, and removal of software. The installation information, and optionally the files themselves, are packaged in installation packages, loosely relational databases structured as COM Structured Storages and commonly known as "MSI files", from their default filename extensions. The packages with the file extensions mst
contain Windows Installer "Transformation Scripts", those with the msm
extensions contain "Merge Modules" and the file extension pcp
is used for "Patch Creation Properties". Windows Installer contains significant changes from its predecessor, Setup API. New features include a GUI framework and automatic generation of the uninstallation sequence. Windows Installer is positioned as an alternative to stand-alone executable installer frameworks such as older versions of InstallShield and NSIS.
The Web Server Gateway Interface is a simple calling convention for web servers to forward requests to web applications or frameworks written in the Python programming language. The current version of WSGI, version 1.0.1, is specified in Python Enhancement Proposal (PEP) 3333.
Windows Presentation Foundation (WPF) is a free and open-source user interface framework for Windows-based desktop applications. WPF applications are based in .NET, and are primarily developed using C# and XAML.
DNN Platform is a web content management system and web application framework based on the .NET Framework. It is open source and part of the .Net Foundation.
Microsoft BizTalk Server is an inter-organizational middleware system (IOMS) that automates business processes through the use of adapters which are tailored to communicate with different software systems used in an enterprise. Created by Microsoft, it provides enterprise application integration, business process automation, business-to-business communication, message broker and business activity monitoring.
In the field of programming a data transfer object (DTO) is an object that carries data between processes. The motivation for its use is that communication between processes is usually done resorting to remote interfaces, where each call is an expensive operation. Because the majority of the cost of each call is related to the round-trip time between the client and the server, one way of reducing the number of calls is to use an object that aggregates the data that would have been transferred by the several calls, but that is served by one call only.
Visual Basic (VB) before .NET, sometimes referred to as Classic Visual Basic, is a third-generation programming language, based on BASIC, and an integrated development environment (IDE), from Microsoft for Windows known for supporting rapid application development (RAD) of graphical user interface (GUI) applications, event-driven programming and both consumption and development of components via the Component Object Model (COM) technology.
Apache Axis2 is a web service engine. It is a redesign and re-write of the widely used Apache Axis SOAP stack. Implementations of Axis2 are available in Java and C.
SharePoint is a collection of enterprise content management and knowledge management tools developed by Microsoft. Launched in 2001, it was initially bundled with Windows Server as Windows SharePoint Server, then renamed to Microsoft Office SharePoint Server, and then finally renamed to SharePoint. It is provided as part of Microsoft 365, but can also be configured to run as on-premises software.
Visual Studio is an integrated development environment (IDE) developed by Microsoft. It is used to develop computer programs including websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platforms including Windows API, Windows Forms, Windows Presentation Foundation (WPF), Microsoft Store and Microsoft Silverlight. It can produce both native code and managed code.
Razor is an ASP.NET programming syntax used to create dynamic web pages with the C# or VB.NET programming languages. Razor was in development in June 2010 and was released for Microsoft Visual Studio 2010 in January 2011. Razor is a simple-syntax view engine and was released as part of MVC 3 and the WebMatrix tool set.
OWIN is a standard for an interface between .NET Web applications and Web servers. It is a community-owned open-source project. Prior to OWIN, Microsoft's ASP.NET technology was designed on top of IIS, and Web applications could not easily be run on another Web server. OWIN aims to decouple the relationship between ASP.NET applications and IIS by defining a standard interface. Developers of Web servers can be sure that, if they implement OWIN correctly, ASP.NET applications will run on their server. Similarly, new Web frameworks could be developed as an alternative to ASP.NET. As long as they target OWIN, they will run on any OWIN compatible Web server, including IIS.
ASP.NET Web Forms is a web application framework and one of several programming models supported by the Microsoft ASP.NET technology. Web Forms applications can be written in any programming language which supports the Common Language Runtime, such as C# or Visual Basic. The main building blocks of Web Forms pages are server controls, which are reusable components responsible for rendering HTML markup and responding to events. A technique called view state is used to persist the state of server controls between normally stateless HTTP requests.
Microsoft Docs was a library of technical documentation for end users, developers, and IT professionals who work with Microsoft products. The Microsoft Docs website provided technical specifications, conceptual articles, tutorials, guides, API references, code samples and other information related to Microsoft software and web services. Microsoft Docs was introduced in June 2016 as a replacement for the MSDN and TechNet libraries which previously hosted some of these materials. Microsoft Docs initially contained only .NET documentation. The process of migrating the bulk of the MSDN and TechNet libraries' content took approximately two years.