๐ŸŸฃ

ASP.NET

ASP.NET is Microsoft's original, Windows-only web application framework, built on the classic .NET Framework and predating the cross-platform ASP.NET Core rewrite. It's the #12 most-used web framework overall, reported in roughly 14.2% of developer surveys โ€” a figure kept high by the large amount of legacy enterprise .NET software still running in production. It's used today mainly to maintain existing systems built before Microsoft's shift to ASP.NET Core.

Quick facts
Type: Web application framework (legacy, Windows-only)
Made by: Microsoft
License: Proprietary; free to use with Visual Studio
Language: C# / .NET Framework
Primary use case: Maintaining and extending existing legacy enterprise Windows web applications
Jump to: ExampleGetting startedBest for

Example

A classic ASP.NET MVC controller action returns a view or JSON, following the same MVC pattern later carried into ASP.NET Core.

using System.Web.Mvc;

public class ProductsController : Controller
{
    public ActionResult Details(int id)
    {
        var product = ProductRepository.GetById(id);
        if (product == null)
            return HttpNotFound();

        return View(product);
    }

    [HttpPost]
    public JsonResult Create(string name, decimal price)
    {
        var product = new Product { Name = name, Price = price };
        ProductRepository.Save(product);
        return Json(new { success = true });
    }
}

Getting started

Create a new ASP.NET MVC project from Visual Studio's project templates, or scaffold one from the .NET Framework CLI template pack on Windows.

:: from Visual Studio: File > New Project > ASP.NET Web Application (.NET Framework)
:: choose the "MVC" template, then build and run with IIS Express

:: or scaffold via CLI template pack
dotnet new mvc -f net48 -o MyLegacyApp
Best for: Windows-only enterprise environments maintaining an existing ASP.NET codebase that predates ASP.NET Core โ€” new projects today should generally start on cross-platform ASP.NET Core instead.