ASP.NET is a mature, server-side web de­vel­op­ment framework from Microsoft. De­vel­op­ers use ASP.NET to create dynamic websites, web apps, and web-based services. After decades of de­vel­op­ment, the framework persists today as ASP.NET Core.

The developer history of ASP.NET

Orig­i­nal­ly developed by Microsoft, ASP.NET now belongs to the .NET Foun­da­tion. While the first versions were still released as pro­pri­etary software, today’s modern ASP.NET is an open-source project.

The ASP.NET used today is the result of a decades-long de­vel­op­ment process. The evolution has taken it from ASP to ASP.NET to ASP.NET Core. In line with the progress of web tech­nol­o­gy, the framework underwent drastic changes over the years. Let’s first take a look at the de­vel­op­ment history of ASP.NET:

Tech­nol­o­gy De­vel­op­ment en­vi­ron­ment Current version File ending
ASP Windows 3.0 / 2000-02 .asp
ASP.NET Windows 4.8 / 2019-04 .aspx/.aspx.cs, .aspx.vb etc.
ASP.NET Core Cross-platform 5.0 / 2020-11 .cshtml, .vbhtml, etc.
Tip

Create your own website without any pro­gram­ming know-how! With MyWebsite Website Builder from IONOS. It’s super simple.

Active Server Pages (ASP): Microsoft’s first server-side scripting language

The original “Active Server Pages” (ASP) was the first server-side scripting language published by Microsoft. Active Server Pages let you create dynamic web pages on the server since 1996. Other scripting languages typically rely on Linux as the operating system and an open-source web server such as Apache. In contrast, Microsoft po­si­tioned Active Server Pages as part of the “Internet In­for­ma­tion Server” (IIS) running on Windows.

The basic func­tion­al­i­ty of ASP is roughly com­pa­ra­ble with PHP or the “Java Server Pages” (JSP). All three tech­nolo­gies use template files. These template files contain ex­e­cutable code snippets embedded in static HTML content. The code is written between special tags to separate it from the sur­round­ing HTML. The pro­gram­ming languages used were the Microsoft-specific dialects VBScript, JScript, and PerlScript, which were available at the time.

When a URL is accessed by the browser (“request”), the code is executed on the server. The execution generates HTML content that is inserted into the pre­de­fined HTML struc­tures. The overall result is a document con­sist­ing of static and dy­nam­i­cal­ly-generated HTML content; this is delivered as a response to the browser (“response”) and displayed to the user. Any change to page content, such as user input, required a complete request-response cycle, in other words, a reload of the page. Here is an example of ASP code:

<p>
    The server’s current time:
    <%
        Response.Write Now()
    %>
</p>

ASP was not yet a framework. Rather, it used a loose col­lec­tion of a handful of objects. From these, users were able to piece together a dynamic website:

  • Ap­pli­ca­tion
  • Request
  • Response
  • Server
  • Session
  • ASPError

ASP.NET: from the Active Server Pages to the Framework

ASP.NET, the successor to the classical ASP, was in­tro­duced around 2003. Instead of a loose col­lec­tion of objects, the .NET Framework was used as a sub-structure. This ab­stract­ed commonly needed processes such as user au­then­ti­ca­tion as well as au­tho­riza­tion and database access. In summary, ASP.NET is roughly com­pa­ra­ble with Java frame­works such as “Struts” or “Spring”.

As a crucial feature, ASP.NET included “Web Forms”. The Web Forms approach allowed ex­pe­ri­enced Windows de­vel­op­ers to program dynamic web pages. This process meant that the web’s un­der­ly­ing mech­a­nisms were hidden from de­vel­op­ers; they could continue to use workflows and de­vel­op­ment en­vi­ron­ments with which they were familiar. More specif­i­cal­ly, Microsoft-specific visual rapid ap­pli­ca­tion de­vel­op­ment (RAD) tools were used.

Web Forms provided Windows de­vel­op­ers with a quick entry point into online pro­gram­ming. At the same time, however, the approach limited control over the HTML pages that were being delivered. ASP.NET MVC was soon added as an al­ter­na­tive de­vel­op­ment model. This followed the es­tab­lished “Model View Con­troller” (MVC) pattern and allowed concerns to be separated more clearly. Based on the pi­o­neer­ing framework “Ruby on Rails”, ASP.NET MVC offered func­tion­al­i­ty for “scaf­fold­ing” a project.

In the meantime, ASP.NET has been replaced by the further developed “ASP.NET Core”. In everyday language, however, both names are often used syn­ony­mous­ly.

ASP.NET Core: new de­vel­op­ments through an open-source license

With the release of ASP.NET Core, a change in the or­ga­ni­za­tion of the framework took place. In the course of Microsoft’s pro­gres­sive de­vel­op­ment, ASP.NET Core was placed under the umbrella of the .NET Foun­da­tion. The source code of the project is available under an open-source license.

On a technical level, ASP.NET Core is a re-design of ASP.NET 4.0, merging the or­gan­i­cal­ly grown com­po­nents of ASP.NET. ASP.NET Core project de­vel­op­ment and hosting outside of the Windows ecosystem has been enabled. On Windows, ASP.NET Core is built on top of the .NET Framework; on other operating systems, the .NET Core Framework is used instead.

In line with the ongoing evolution of web tech­nol­o­gy, ASP.NET Core is ready for the cloud. ASP.NET hosting en­vi­ron­ments include open server en­vi­ron­ments as well as con­tain­ers, in addition to Microsoft’s tra­di­tion­al Internet In­for­ma­tion Server (IIS). The framework supports client-side code and modern ap­proach­es to re­spon­sive pro­gram­ming. This puts ASP.NET Core on par with JavaScript-based frame­works such as React.

What kind of projects is ASP.NET suited for?

Web projects of all kinds can be realized with the ASP.NET Framework. In par­tic­u­lar, this includes dynamic websites and web ap­pli­ca­tions, including “Single Page Apps” (SPA). Fur­ther­more, web-based services such as APIs and systems for real-time com­mu­ni­ca­tion can be im­ple­ment­ed. Over the years, different ap­proach­es have been used for the various purposes. We’ll discuss these below and provide an overview of their de­vel­op­ment.

Pro­gram­ming models in ASP.NET

While web tech­nolo­gies have advanced since the 2000s, new ap­proach­es to web de­vel­op­ment have also been in­te­grat­ed into ASP.NET. You can think of it like a well-sorted toolbox: Different tools are available for different kinds of projects. Depending on the re­quire­ments, several ap­proach­es can be combined within one project. With the release of ASP.NET Core, the numerous, or­gan­i­cal­ly grown pro­gram­ming models were merged. This led to a sim­pli­fi­ca­tion of suitable ap­proach­es.

ASP.NET Web Forms

Classic Web Forms are used to assemble pages from pre­de­fined com­po­nents. Here, a visual form builder is used that allows in­di­vid­ual com­po­nents to be po­si­tioned by drag-and-drop. This was par­tic­u­lar­ly at­trac­tive for de­vel­op­ers with ex­pe­ri­ence in Windows pro­gram­ming. They could use the tools they were familiar with for “Rapid Ap­pli­ca­tion De­vel­op­ment” (RAD). The dif­fer­ence was that the end-product was not a Windows ap­pli­ca­tion, but a dynamic website.

The Web Forms approach is based on Microsoft’s “Code Behind” model. This makes sure that concerns are separated:

  • Template files with the extension .aspx define the HTML structure of a page and contain place­hold­ers for dy­nam­i­cal­ly generated content.
  • The actual ap­pli­ca­tion logic is stored in a separate file with the extension .aspx.cs or .aspx.vb. This is the Code Behind file that gives it its name.
  • The client retrieves the .aspx file available in a URL. On the server, the static and dynamic com­po­nents are combined. The resulting HTML document is delivered to the client.
  • When user input is received on the page, the data is trans­ferred to the same URL via a GET or POST request and processed by the Code Behind file.

An object-oriented approach is used to implement the ap­pli­ca­tion logic: the Code Behind file defines a derived class. C# or Visual Basic is usually used as the pro­gram­ming language. In­ter­est­ing­ly, the Code Behind file is pre­com­piled once. This leads to faster execution and greater ro­bust­ness against errors when the page is called up.

ASP.NET MVC

In contrast to the original ASP, Web Forms were a step towards sep­a­ra­tion of concerns. With ASP, static HTML and code com­po­nents were mixed in one and the same file. With Web Forms, the sep­a­ra­tion into template and Code Behind files occurred. With ASP.NET MVC, ASP.NET got another pro­gram­ming model that allowed web de­vel­op­ment according to the Model View Con­troller (MVC) pattern.

The MVC pattern separates ap­pli­ca­tion logic (“Model”), pre­sen­ta­tion template (“View”), and user in­ter­ac­tion (“Con­troller”). One of the ad­van­tages of the MVC approach is that the in­di­vid­ual concerns can be better tested. Fur­ther­more, the sep­a­ra­tion of the concerns allows different con­trollers to be used. For example, instead of sending all user input to a single URL and reloading the page, AJAX via jQuery is used. This allows parts of the page to be reloaded. With ASP.NET Core MVC, the tradition of ASP.NET MVC continues into today’s version of the framework.

ASP.NET Web Pages

ASP.NET Web Forms and ASP.NET MVC are well suited for creating complex websites. If you need multiple pages with reusable com­po­nents, both pro­gram­ming models are ideal. But what if you don’t need this? Let’s say we want to build a simple website that consists of only a single page or a handful of pages. There are a few dynamic com­po­nents, but the focus is on a polished layout rather than complex ap­pli­ca­tion logic and pro­cess­ing user input. In that case, it would be overkill to define custom classes or aim for a split along the MVC pattern.

For cases where ap­pli­ca­tion logic is less important than a so­phis­ti­cat­ed layout and design, ASP.NET Web Pages are a good choice. Like classic ASP or PHP, a com­bi­na­tion of static HTML struc­tures and dynamic code com­po­nents takes place within a file so that a special syntax is used. ASP.NET Web Pages are par­tic­u­lar­ly well suited for the creation of landing pages.

ASP.NET Web API

The pro­gram­ming models presented so far all aim to generate HTML content for humans. However, the ASP.NET Framework also contains models that are used to provide in­fra­struc­ture for web projects. ASP.NET Web API is a pro­gram­ming model for creating REST APIs. Access to the API endpoints takes place via AJAX. JSON or XML is used for data transfers.

ASP.NET WebHooks

ASP.NET WebHooks is an im­ple­men­ta­tion of the WebHooks pattern. WebHooks lets you publish and subscribe to events that take place in a system. For example, this could be the addition of a file or the receipt of a payment. A sub­scriber registers the change to be tracked with the pub­lish­ing system. To do this, they pass a URL – the namesake WebHook. When the reg­is­tered event occurs, the pub­lish­ing system calls the WebHook; the sub­scriber is informed about the event.

SignalR

SignalR is a framework for real-time com­mu­ni­ca­tion between client and server. The framework is based on the Web­Sock­ets standard and allows the bidi­rec­tion­al transfer of data. Browsers that don’t support Web­Sock­ets are supported via fallback mech­a­nisms. SignalR is often used to implement browser-based chat services and video con­fer­enc­ing software.

New pro­gram­ming models in ASP.NET Core

ASP.NET Core is the successor to ASP.NET. The ASP.NET Core framework has been rewritten, but has a high degree of com­pat­i­bil­i­ty with its pre­de­ces­sor. Pre­vi­ous­ly separate com­po­nents of ASP.NET were merged into the Core version. Fur­ther­more, some com­po­nents were re­de­vel­oped and retained their existing names. For example, the SignalR Framework exists in both ASP.NET and ASP.NET Core versions. Let’s take a look at the main new de­vel­op­ments of ASP.NET Core.

ASP.NET Core MVC – API-driven model view con­troller sites

With ASP.NET Core MVC, func­tion­al­i­ties of ASP.NET MVC and ASP.NET Web API have been combined. This enables the de­vel­op­ment of highly dynamic web ap­pli­ca­tions with a modular user interface and un­der­ly­ing API. The .NET Core Framework is used as the common foun­da­tion. Familiar ap­proach­es from .NET API de­vel­op­ment can be trans­ferred to MVC de­vel­op­ment and vice versa.

Razor Pages – further de­vel­op­ment of ASP.NET Web Pages

Razor Pages fill a similar niche as the former ASP.NET Web Pages. They can be used when the Model-View-Con­troller pattern rep­re­sents un­nec­es­sary overhead. For example, if you want to build a landing page, it can be im­ple­ment­ed as a Razor Page with little effort. The Razor syntax is used to create the page template. As is typical in the .NET universe, C# and Visual Basic can be used as pro­gram­ming languages.

Let’s take a look at an example Razor page. It is no­tice­able that instead of the usual opening and closing code tags in template languages, an opening @ character is used:

@page
@model HelloWorldModel
 
@if (Name != null) {
    <p>Hello dear @Name</p>
}
<form method="post">
    <p>
        <label asp-for="Name"></label>
        <input class="form-control" asp-for="Name" />        
    </p>
    <input type="submit" value="Say Hello" />
</form>

Reactive pro­gram­ming with Blazor – “NET in the browser”

The Blazor framework relies on the afore­men­tioned Razor syntax; in fact, Blazor stands for “Browser + Razor”. As the name implies, the focus of Blazor is on the browser as a runtime en­vi­ron­ment. With Razor Pages, the pro­cess­ing of user in­ter­ac­tion takes place on the server. Blazor, on the other hand, enables reactive pro­gram­ming, where in­di­vid­ual page com­po­nents in the browser react dy­nam­i­cal­ly to changes. This makes Blazor roughly com­pa­ra­ble to React, Angular, and Vue tech­nolo­gies.

Here’s a simple example of reactive pro­gram­ming with Blazor. We bind the value of an input field to the variable Name. The Razor syntax is used for this:

@page "/"
<h1>A Blazor example</h1>
<p>Welcome to Blazor, @Name.</p>
<input bind="@Name" type="text" class="form-control" placeholder="Name" />

In addition to reactive pro­gram­ming, another feature of Blazor is highly in­ter­est­ing: Via We­bAssem­bly, the .NET languages can be compiled for execution in the browser. Blazor is therefore sometimes also referred to as an approach for “.NET in the browser”. The advantage is not having to write JavaScript for the client-side code. Instead, de­vel­op­ment is done in C# or Visual Basic; the code can access the familiar com­po­nents of the .NET framework.

What are the ad­van­tages and dis­ad­van­tages of ASP.NET?

ASP.NET or ASP.NET Core provides a mature en­vi­ron­ment for de­vel­op­ing a wide variety of web projects. The scope includes pro­gram­ming languages, code editors, and IDEs, as well as de­vel­op­ment tools and a thriving ecosystem of freely available packages. Nowadays, modern methods such as reactive pro­gram­ming, Web­Sock­ets, and We­bAssem­bly are used. Tra­di­tion­al­ly, the biggest drawback to using ASP.NET has been its close ties to Microsoft and the vendor lock-in that comes with it. With the pro­gres­sive move towards open source, this is now less of a concern.

What are the ad­van­tages of ASP.NET?

The biggest advantage of using ASP.NET is drawn by de­vel­op­ers who are familiar with pro­gram­ming in the Microsoft ecosystem. They can com­fort­ably access the languages, tools, and workflows they are familiar with. The mature .NET Framework is used as the foun­da­tion of ASP.NET. This means, that suitable com­po­nents are available for a large number of use cases. This is a great advantage when it comes to im­ple­ment­ing complex ap­pli­ca­tions quickly and with reliable results.

The .NET Framework has a modular structure and features the “Common Language Runtime” (CLR) as a runtime en­vi­ron­ment. This allows the use of various pro­gram­ming languages as long as they comply with the Common Language In­fra­struc­ture (CLI) standard. The CLI languages developed by Microsoft include the object-oriented classics C# and Visual Basic as well as the newer func­tion­al language F#. Using Blazor and We­bAssem­bly, the CLI languages can be executed as client-side code in the browser.

Orig­i­nal­ly, ASP.NET began as pro­pri­etary software under the control of Microsoft. Today, it is an open-source project under the .NET Foun­da­tion. As part of this opening, the NuGet package manager and as­so­ci­at­ed public package repos­i­to­ry were es­tab­lished. Com­pa­ra­ble to NPM or RubyGems, ASP.NET de­vel­op­ers have an ecosystem of freely usable packages at their disposal.

What are the dis­ad­van­tages of ASP.NET?

The biggest advantage of ASP.NET – the use of the Microsoft-specific ecosystem – is also its main dis­ad­van­tage. That’s because web de­vel­op­ment is otherwise largely built on free and open platforms, languages, and formats. De­vel­op­ers diving into the .NET universe for the first time are presented with a be­wil­der­ing array of versions and pro­gram­ming models.

Tra­di­tion­al­ly, those who wanted to develop with the ASP.NET Framework could do so only on Windows. For years, Microsoft has been ramping up an effort to open-up to widely used standards and open source. With the release of ASP.NET Core, de­vel­op­ment now works on the three major operating system: Windows for families, macOS, and Linux. Fur­ther­more, it’s now possible to store the de­vel­op­ment en­vi­ron­ment in a Docker container.

Classic ASP.NET could only be hosted on Microsoft’s in-house server tech­nol­o­gy Internet In­for­ma­tion Server (IIS). This was a major dis­ad­van­tage compared to other web frame­works, all of which also run on Linux. ASP.NET hosting has special re­quire­ments and is not available from all providers. It was possible to use other web servers with “Mon” as a free .NET im­ple­men­ta­tion. However, the real change came with the release of .NET Core and the “Open Web Interface for .NET” (OWIN). OWIN dis­so­ci­ates an ASP.NET ap­pli­ca­tion from the un­der­ly­ing web server. This removed one of the biggest hurdles to using ASP.NET.

What are the re­quire­ments for the APS.NET hosting en­vi­ron­ment?

The ASP.NET framework is special in terms of the hosting en­vi­ron­ment. Other web frame­works based on the PHP, Java, Python, or JavaScript languages all run on Linux servers. Only hosting ASP.NET ap­pli­ca­tions tra­di­tion­al­ly required Windows as the server operating system. It was also mandatory to use Microsoft’s Internet In­for­ma­tion Services (IIS) web server. To host an ASP.NET ap­pli­ca­tion on Windows servers, you should pick Managed Windows Hosting. With this hosting model, your servers are main­tained by the provider and regularly updated.

Hosting ASP.NET core ap­pli­ca­tions is much more relaxed. These can be hosted on a variety of server en­vi­ron­ments in addition to IIS. The in­te­grat­ed Kestrel web server is used, which runs on Windows, Linux, and macOS. Popular web servers such as Nginx and Apache can be con­fig­ured as reverse proxies in con­junc­tion with Kestrel. On Windows, the Kestrel al­ter­na­tive HTTP.sys is also available.

Tip

Use ASP.NET hosting from IONOS!

Go to Main Menu