from Wikipedia, the free encyclopedia
Basic data

developer Microsoft
Publishing year January 2003
Current  version 4.8
( April 2019 )
operating system from Windows 2000
category Web development
License Apache License 2.0
German speaking Yes
MSDN library

ASP.NET ( A ctive S erver P ages .NET ) is a web application framework from Microsoft , with which dynamic websites , web applications and web services can be developed. ASP.NET is the successor to Active Server Pages (ASP) and the first version appeared in 2002. ASP.NET is part of the classic .NET framework up to the current version 4.8. In parallel, there has been ASP.NET Core since 2015 , a separate open source framework that also officially supports GNU / Linux and Mac OS X. In the future .NET 5.0, which is based on .NET Core technology, parts of the previous ASP.NET will be eliminated (ASP.NET Webforms, ASP.NET Webservices).

ASP.NET is used as a server-side programming language on around 11.5% of all websites and is therefore the second most frequently used server-side language for creating after PHP (79.0%) and ahead of third-placed Java (4%) from websites (as of March 12, 2019).



Overview of how ASP.NET works

ASP.NET belongs to the .NET Framework and represents a method to manage .NET applications in IIS or other web servers compatible with ASP.NET (“hosting”). ASP.NET provides classes that are common to all web applications, such as the authentication and authorization of users. The most important element here is the HTTP runtime environment, which processes HTTP requests.

With ASP.NET, web applications can be created in languages ​​supported by .NET (theoretically all CLR -compatible languages); object-oriented languages ​​such as C # and VB.NET are almost exclusively used . The language selection is usually only restricted by the respective development environment . ASP.NET is therefore not a programming language, but a bundling of technologies. ASP.NET languages ​​are not interpreted, but translated and compiled in CIL .

The respective methods, such as ASP.NET WebForms, ASP.NET AJAX, ASP.NET MVC, ASP.NET Dynamic Data, ASP.NET WebAPI and ASP.NET SignalR, are based on the ASP.NET platform. Handlers are implemented.

ASP.NET Web Forms

The Web Forms form the basic building block for developing web content with ASP.NET in its classic form. Web Forms are contained in files with the file extension .aspx. The ASPX files typically contain static ( X ) HTML markup as well as the “Web Controls” and “User Controls”, which are processed on the web server according to the logic stored on the server side and are output as dynamic (X) HTML code. Examples of web controls that Microsoft supplies as standard are a calendar control or the grid view ( table view of data ).

In addition, dynamic code content that is to be executed by the server can be <% -- dynamic code -- %>stored in the form within an ASPX file . This type of embedding is very similar to the constructs of other web programming languages ​​such as PHP , JSP and ASP . However, the developer should avoid using program code nested in the HTML code, as the compiler only checks this code when it is executed on the web server. The code of separately written “code-behind” files (see below), on the other hand, is completely checked by the compiler, which achieves higher runtime security.

With the ASP.NET Framework 2.0 Microsoft published the novel approach of the “code-behind” model. Static content remains in the ASPX file, while the dynamic code is transferred to a file of the type .aspx.vbor .aspx.csrespectively .aspx.fs. The file type depends on the .NET language used. Developers who do not want to work with the “code-behind” approach can override the Render function and generate HTML themselves (completely independent of the design view).

Code-behind model

Microsoft recommends using the “code-behind” approach for the dynamic code portions. The code-behind files usually have the file extension .aspx.csor .aspx.vb. The file name of the ASPX file always corresponds exactly to the name of the "code-behind" file, only the file name extensions are different . Microsoft Visual Studio and other IDEs provide this type of development by default. The code of such a "code-behind" file is compiled before the relevant page is called up. This lowers the error rate compared to script languages in which the error check only takes place at runtime. In the "code-behind" file, the developer has the option of reacting to a wide variety of events in the life cycle of an ASP Web Forms web page, including not just e.g. B. the loading of the website, but also events that result from user interactions with web form content, such as the click of a button.

The program model (with events that are triggered by controls) is very similar to that of .NET applications, so developers who have already written applications for the .NET Framework can use ASP.NET (and C # / VB. NET) is easily possible. In most cases, functions or classes programmed for Windows applications can still be used in ASP.NET without changing them.

With this approach, ASP.NET differs significantly from classic ASP. A first separation of code for display and content is achieved. Similar to the separation between “View” and “Controller” in the MVC pattern, this separation allows better development based on the division of labor, for example through a division between the web designer who processes the ASPX file and the programmer who creates the “code-behind” file . The newer component ASP.NET MVC conceptually emphasizes this type of separation of concerns in an even stronger way .


With directives it is possible to declare in an ASPX file how ASP.NET should process this page. The most commonly used directive is <%@ Page %>. This allows various settings to be made, above all the specification of the programming language in which the dynamic content is programmed. For example, the code example in this article has the <%@ Page %>directive on the first line.

User controls

User controls encapsulate certain sections of pages in a separate file with the extension .ascx. These ASCX files are registered within the ASP.NET project and can be used on ASPX pages just like the predefined "Web Controls". The ASCX files typically contain ( X ) HTML code as well as server-side controls. A "User Control" is compiled when the page on which the control is integrated is called. The "User Control" is kept in memory for possible subsequent requests. "User controls" bring their own "events", which can also be handled individually by the developer. All "User Controls" are bound to be called from an ASPX page. It is not possible to call up a "User Control" directly in the web browser.

Individualized controls

Programmers can define self-defined controls ("Custom Controls") in their ASP.NET web applications. In contrast to "User Controls", "Custom Controls" are not defined in an ASCX file, but their code is compiled into a DLL file. Once such “custom controls” have been defined, the developer can use them in various web applications and Visual Studio projects.

These options for developing your own controls for ASP.NET form the basis for a large number of controls from third-party providers that are available free of charge or for a fee. There is now a very extensive market through which a large number of reusable controls are freely or commercially available. Complex requirements therefore often do not need to be developed in-house.

View State

With the ViewState technology, ASP.NET supports an extended way of retaining memory contents between individual page views. While with the session state technology with Active Server Pages there was previously only a memory management that was detached from the page views, the developer with ASP.NET has the option of storing memory contents in a ViewState collection so that they can be accessed the next time a page is called up. In contrast to the session state, the ViewState is not stored on the server, but in the returned page.

With the ViewState technology supported by ASP.NET, controls retain their status even after successive page views. This relieves developers of the work to implement this themselves. Sun is pursuing a similar concept with the JavaServer Faces (JSF).

Code example

ASPX file

The following example code generates a basic output on the screen when executed on the supplied Web server of Visual Studio ; this follows the standard content that Microsoft generates when creating a new ASPX page (in ASP.NET 4).

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="ASP.NET_Beispiel._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        Welcome to ASP.NET!
        To learn more about ASP.NET visit <a href="" title="ASP.NET Website"></a>.
        You can also find <a href=";clcid=0x409"
            title="MSDN ASP.NET Docs">documentation on ASP.NET at MSDN</a>.
Code-behind file

The source code cited below, which is stored in the “code-behind” file, belongs to the ASP code shown. In this case, the C # programming language is used, VB.NET is a common alternative as described.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ASP.NET_Beispiel
    public partial class _Default : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)


".designer.cs" file One is also generated that is Default.aspx.designer.csalways auto- generated based on the ASPX template. Since the programmer does not change anything in this file (or his changes would be overwritten), its source code is not shown here.

Other components

  • ASP.NET offers the concept of web parts . These can be used to create intranets in which each user can configure what he wants to see where on the page.
  • ASP.NET AJAX is a part of ASP.NET that can be used to develop Ajax websites under ASP.NET. It includes class libraries and controls.
  • ASP.NET Webservices is a sub-framework for developing web services based on the SOAP , WSDL and XSD standards . It first appeared as part of the .NET Framework 2.0. According to the file name extension of such web services, ASP.NET web services are also referred to as ASMX .
  • ASP.NET Web Pages are an alternative to Web Forms and MVC.
  • ASP.NET MVC is also an alternative to Web Forms and Web Pages.
  • ASP.NET SignalR
  • ASP.NET Dynamic Data is a Web Forms-based framework for creating web applications, which automatically determines the underlying data model at runtime and determines the behavior of the user interface based on it. Only a relatively small amount of programming is required.

SOAP extensions

The ASP.NET SOAP Extension Framework enables ASP.NET components to process SOAP messages. However, we recommend using the Windows Communication Foundation (WCF) to create and connect to SOAP web services .


Basic data

developer Microsoft
Publishing year 2016
Current  version 3.0
(September 23, 2019)
operating system platform independent
programming language various
category Web development
License WITH

With the development of .NET Core, ASP.NET was also fundamentally revised. You can also use it to develop web applications for non-Windows platforms (supported by .NET Core). The new framework has been called ASP.NET Core since January 2016 (temporarily also ASP.NET 5). In contrast to ASP.NET, ASP.NET Core is developed as an open source project. Up to version 2.2, ASP.NET Core could still be used together with newer versions of the classic .NET Framework , but from 3.0 onwards only with the new, modular .NET Core framework . Applications that were developed with ASP.NET are only compatible with the classic .NET framework.

ASP.NET Core contains the ASP.NET MVC and ASP.NET Web Pages frameworks . ASP.NET Web Api is integrated into the MVC framework. Web Forms was last supported with .NET version 4.8 and is no longer ported to .NET Core.

From version 2 there is the possibility to simplify the MVC pattern with the help of so-called "Razor Pages". This approach is Microsoft's recommended practice.

With version 2.1 in May 2018, in addition to numerous smaller improvements, the Signal.R Framework (see below) was provided in an ASP.NET Core version (ASP.NET Core SignalR).

With version 3 a new framework called server-side Blazor was added, which supports the development of interactive web interfaces with C # (without the necessary JavaScript programming). The Signal.R based on websockets is used for communication. This means that a Blazor server can also transfer messages asynchronously to the client (browser) in order to update the content displayed in the HTML pages promptly and without user interaction. During the development of the framework, the name Razor Components was also used at times . In addition, there has also been a variant Blazor Webassembly since May 2019 , in which the web interface and C # code are executed directly in the browser with the help of WebAssembly . This can be done either stand-alone or with the support of an ASP.NET Core Server. Optionally, the web application can also be installed as a progressive web app (PWA) and thus run without a browser.

Other ingredients and supplements

The following frameworks are available for ASP.NET 5 as well as for earlier versions.


The ASP.NET MVC is an implementation of the MVC pattern and allows dynamic websites particularly clear in the three areas M odel (data model), V iew (view) and C ontroller to structure (control). This is required by the underlying architecture and enables a clear separation of concerns . MVC also supports the test-driven development approach in a special way, since with ASP.NET MVC no web server is required for the unit tests (in contrast to the situation with WebForms).

ASP.NET MVC was originally designed as an extension module for web browsers (“plug-in”), which is based on WebForms. In the meantime, however, ASP.NET MVC has become an integral part of the ASP.NET Framework and is independent of WebForms.


ASP.NET Web API enables REST web services to be implemented. Data is transferred in the form of JSON , XML or OData . A JavaScript script on a website can access these services with the help of Ajax or AJAJ and thus transfer data in the background. This enables the creation of highly dynamic rich client websites.

As of version ASP.NET Core 1.0, the Web API is part of the ASP.NET MVC framework.


ASP.NET SignalR transfers data bidirectionally between the client and the server and is based on the WebSockets network protocol . If the client's browser does not support WebSockets, SignalR uses other methods of data transfer ( fallback ). SignalR thus simplifies the implementation of real-time applications such as chat or video conferencing .

ASP.NET Web Pages

ASP.NET Web Pages is a framework for creating dynamic websites . The Microsoft WebMatrix tool can be used to create such pages . Razor is a syntax of the C # and Visual Basic .NET programming languages ​​that is used when creating Web pages.

ASP.NET WebHooks

ASP.NET WebHooks is an open source framework that implements the WebHooks method and is based on the ASP.NET Web API. It facilitates the consumption of events from web services.


ASP.NET succeeded the outdated ASP (Active Server Pages) with the first version in 2002 , but today has little to do with the old technology other than the name. ASP.NET is version 1.0 "final" since 2002. The finished version of ASP.NET 2.0 has been available since October 28, 2005. With ASP.NET 2.0, much less code (up to 70 percent according to Microsoft) is required to create a dynamic Web site. With version 3.5, ASP.NET was expanded to include support for Ajax and LINQ . Version 4.5 appeared at the same time as the version of the .NET Framework on August 15, 2012.

version Corresponding Visual Studio version publication
Older version; no longer supported: 1.0 Microsoft Visual Studio .NET January 2002
Older version; no longer supported: 1.1 Microsoft Visual Studio .NET 2003 April 2003
Older version; no longer supported: 2.0 Microsoft Visual Studio 2005 November 2005
Older version; no longer supported: 3.0 n / A November 2006
Older version; no longer supported: 3.5 Microsoft Visual Studio 2008 November 2007
Older version; no longer supported: 4.0 Microsoft Visual Studio 2010 April 2010
Older version; still supported: 4.5 Microsoft Visual Studio 2012 August 2012
Older version; still supported: 4.6 Microsoft Visual Studio 2015 July 2015
Current version: 4.7 Microsoft Visual Studio 2017 April 2017
Older version; no longer supported
Older version; still supported
Current version
Current preliminary version
Future version

Development environments

Tool supported ASP.NET version License platform
Microsoft Visual Studio Code Core 1.0 & 2.0 open source Windows, MacOS, Linux
Microsoft Visual Studio 2017 2.0, 3.5, 4.0, 4.5, 4.5.1, 4.6, Core 1.0 (formerly 5), Core 2.0 (from version 15.3), MVC 6 commercially Windows
Microsoft Visual Studio 2015 2.0, 3.5, 4.0, 4.5, 4.5.1, 4.6, 5
Microsoft Visual Studio 2013 2.0, 3.5, 4.0, 4.5, 4.5.1
Microsoft Visual Studio 2012 2.0, 3.5, 4.0, 4.5
Microsoft Visual Studio 2010 2.0, 3.5, 4.0
Microsoft Visual Studio 2008 2.0, 3.5
Microsoft Visual Studio 2005 2.0
Microsoft Visual Studio 2017 (Community & Express) 2.0, 3.5, 4.0, 4.5, 4.5.1, 4.6, Core 1.0 (formerly 5), Core 2.0 (from version 15.3), MVC 6 free
Microsoft Visual Studio 2015 (Community & Express) 2.0, 3.5, 4.0, 4.5, 4.5.1, 4.6, 5
Microsoft Visual Studio 2013 (Community & Express) 2.0, 3.5, 4.0, 4.5, 4.5.1
Visual Web Developer Express 2010 4.0
Visual Web Developer Express 2008 2.0, 3.5
Jetbrains Rider
Xamarin Studio
SharpDevelop 1.1, 2.0, 3.5, 4.0, 4.5 open source
MonoDevelop 1.1, 2.0 Windows, mainly Linux , BSD
Embarcadero Delphi commercially Windows
Borland C # Builder
Microsoft WebMatrix free

For smaller companies and independent developers, free community editions of Visual Studio have been available since November 12, 2014 , the functionality of which corresponds to the "Professional" versions.

The ASP.NET Web Matrix community project , a development environment for ASP.NET 1.0 and 1.1, supported by Microsoft, is only of historical interest . For newer ASP.NET versions, Microsoft recommends instead using Visual Web Developer Express as a free development environment or Microsoft WebMatrix, which is suitable for beginners.

Web server

  • Microsoft Visual Studio .NET and Visual WebDeveloper Express from version 2005 contain their own web server, which is why IIS is no longer required for development with these products .
  • Internet Information Services (IIS 5.0 / 6.0 / 7.0) from Windows 2000 (for Windows NT 4 and older, as well as for Windows 9x there is no support). In contrast to IIS version 5, ASP.NET isimplemented directlyunder IIS 6 from Windows Server 2003 onwards, which hasresulted insignificant performance improvements. The IIS are also included - in a limited form - in some non-professional versions of Windows ( Windows XP Professional, Vista from Edition Home Premium ).
  • Apache web server With the Apache modulesmod_aspdotnetandmod_mono, ASP.NET can be integrated into the Apache web server. These also work under Linux or BSD .
  • XSP web server (part of the Mono project ). This server is available for Windows and Linux and can be connectedto the Apache web servervia the Apache module mod_mono . XSP is written in C #, is under an open source license and supports ASP.NET 2.0 (without web parts).
  • Cassini web server . This web server was made available by Microsoft as a lean sample program and is intended to give developers an insight into how “ASP.NET hosting” works. Cassini is implemented in C # and is under a shared source license.



  • Since the .NET Framework itself provides many functions, many requirements (such as image editing or XML processing) are possible without installing additional libraries, in contrast to PHP, for example .
  • By abstracting the functionalities used on a website (from text boxes to buttons to complete calendar control) in server controls, browser-independent websites can be created. In addition, the CSS friendly adapters can be used to influence the generated HTML code (also browser-specific) by standard controls, so that these generate standard-compliant HTML that does not use any tables for layout design. With the abstraction, for example, complete rights management (user / roles) - including user login , “forgot password” and the like - can be implemented in your own site with almost no self-written code, but at least with ready-made classes . It can also be used to protect files.


  • With ASP.NET you have been tied to a server running under Microsoft operating systems. There are free .NET (and ASP.NET) implementations, but they are not (yet) fully compatible and therefore always lag behind new .NET versions by at least a few months. However, because PHP is by far the most widely used scripting language for web programming, many web hosts have focused more on PHP / MySQL hosting on Linux platforms, especially in the area of ​​shared hosting. This limits the freedom of choice in hosting. With the platform-independent ASP.NET Core, there is no restriction on Windows servers.
  • For hosting on Windows servers, license fees are due for the server operating system, which providers have to pass on to the customer in some form.


In addition to the established procedures that ASP.NET uses - i.e. HTML , CSS and JavaScript  - Microsoft has developed Silverlight . Like Flash, Silverlight (formerly WPF / E) is a browser plug-in that tries to circumvent the restrictions of HTML. In contrast to Flash, however, the content (user interface, animation or script) of the applet is sent to the browser in XML (WPF, Windows Presentation Foundation ). As a result, such pages can also be generated with code on the server without any problems, even though programs (expression blend) are used for this. As with ASP.NET, Silverlight development in the Microsoft Visual Studio SDK is the type of programming recommended by Microsoft.

Mono implementation

In connection with Linux, the Mono project should be emphasized, which makes ASP.NET (or the .NET Framework in general) platform-independent . ASP.NET 2.0, ASP.NET MVC and ASP.NET AJAX are currently implemented.

Moonlight is the equivalent of Silverlight in the Mono project.

See also


  • Matthew MacDonald: Beginning ASP.NET 4.5 in C # . Apress, 2012, ISBN 978-1-4302-4251-2 (English).
  • Adam Freeman, Matthew MacDonald, Mario Szpuszta: Pro ASP.NET 4.5 in C # . Apress, 2013, ISBN 978-1-4302-4254-3 (English).
  • Adam Freeman: Pro ASP.NET MVC 4 . Apress, 2012, ISBN 978-1-4302-4236-9 (English).
  • Jamie Kurtz: ASP.NET MVC 4 and the Web API: Building a REST Service from Start to Finish . Apress, 2013, ISBN 978-1-4302-4977-1 (English).
  • Jamal Baydaoui: Developing websites with ASP.NET . Hanser, 2013, ISBN 978-3-446-43723-4 .
  • Holger Schwichtenberg: Microsoft ASP.NET 4.0 with Visual C # 2010. Microsoft Press Germany, Unterschleissheim 2011, ISBN 978-3-86645-530-6 .
  • Jana Frank, Patrick A. Lorenz: ASP.NET 3.5 with AJAX . Carl Hanser Verlag, Munich 2008, ISBN 978-3-446-41199-9 .
  • Chris Hart, John Kauffman, Dave Sussman, Chris Ullman: Beginning ASP.NET 2.0 . Wiley Publishing, 2006, ISBN 0-7645-8850-8 (English).
  • Hannes Preishuber: ASP.NET 2.0 crash course . Microsoft Press, 2006, ISBN 3-86063-988-9 .
  • Holger Schwichtenberg: ASP.NET 2.0 - The developer book. Microsoft Press, 2006, ISBN 3-86063-544-1 (VB) and ISBN 3-86063-546-8 (C #).
  • Christian Wenz, Andreas Kordwig, Christian Trennhaus: Now I'm learning ASP.NET. Market and Technology, October 2004, ISBN 3-8272-6813-3 .

Web links

Wikibooks: Website development with ASP.NET  - learning and teaching materials

Individual evidence

  1. ^ Scott Gu: ASP.NET MVC, Web API, Razor and Open Source. In: ScottGu's blog, March 28, 2012, accessed August 19, 2019 .
  2. Introduction to ASP.NET 5 Conceptual overview of ASP.NET 5.
  3. Roadmap ASP.NET 5 , Roadmap ASP.NET 5.
  4. heise online: Build 2019: Microsoft specifies the plans for .NET 5.0. Retrieved May 9, 2019 .
  5. Usage of server-side programming languages ​​for websites. Retrieved March 14, 2018 .
  6. Overview of ASP.NET and Web Forms . Microsoft Developer Network . November 2001. Retrieved June 5, 2011.
  7. Code Behind vs. Code inline . In: Microsoft .NET Framework . Microsoft . Retrieved November 22, 2010.
  8. ASP.NET Web Page Syntax Overview . In: Microsoft .NET Framework . Microsoft Developer Network . Retrieved November 22, 2010.
  9. Jürgen Mauerer: Web Services with .NET Framework 2.0 and Visual Studio 2005. In: MSDN of June 17, 2005, accessed on December 2, 2015.
  10. Overview of ASP.NET Dynamic Data. In: MSDN , accessed December 2, 2015.
  11. ASP.NET Blog | ASP.NET Core and Blazor updates in .NET Core 3.0. September 23, 2019. Retrieved September 24, 2019 (American English).
  12. Rick-Anderson: Introduction to ASP.NET Core. Accessed March 17, 2019 (German).
  13. .NET Core: Microsoft wants to officially complete API porting ›Dr. Windows. Retrieved on October 19, 2019 (German).
  14. Rick-Anderson: Introduction to Razor Pages in ASP.NET Core. Retrieved September 28, 2017 (American English).
  15. Rick-Anderson: Choose between ASP.NET and ASP.NET Core. Retrieved September 28, 2017 (American English).
  16. Rick-Anderson: Choose between ASP.NET and ASP.NET Core. Retrieved May 8, 2018 (American English).
  17. ASP.NET Core 2.1.0 now available . ( [accessed May 31, 2018]).
  18. guardrex: Introduction to Razor Components. Retrieved March 18, 2019 (German).
  19. ASP.NET Blog | Blazor now in official preview! April 18, 2019, Retrieved April 25, 2019 (American English).
  20. Blazor WebAssembly 3.2.0 now available. May 19, 2020, accessed May 20, 2020 (American English).
  21. heise online: Microsoft wants to bring Framework Blazor to product maturity. Retrieved July 5, 2019 .
  22. ASP.NET Blog | ASP.NET Core and Blazor updates in .NET Core 3.0. September 23, 2019. Retrieved September 24, 2019 (American English).
  23. guardrex: Build Progressive Web Applications with ASP.NET Core Blazor WebAssembly. Retrieved March 17, 2020 (American English).
  25. Patrick A. Lorenz: Between all fronts. in: dotnetpro No. 11/2015, p. 134 ff.
  26. Introducing ASP.NET Web Pages - Getting Started. In: ASP.NET , accessed December 1, 2015.
  27. Patrick A. Lorenz: On the way with Captain Hook. In: dotnetpro No. 12/2015, p. 134 ff.
  28. webplatform.mspx
  31. mod_aspdotnet ., accessed May 23, 2012.
  32. ASP.NET
  33. Renaming of ASP.NET 5 to .NET Core . Microsoft blog entry, February 1, 2016, accessed June 27, 2016.