What is ASP.NET?
ASP.NET is a powerful, feature-rich framework for building modern web applications and services with .NET. It provides a unified programming model that spans the entire spectrum of web development, from simple pages to complex, data-driven sites.
Whether you're creating Razor Pages, MVC applications, Web APIs, or real‑time SignalR hubs, ASP.NET gives you the tools to build fast, secure, and scalable solutions.
Key Features
- Unified development model for Razor Pages, MVC, Web API, and Blazor.
- Built‑in dependency injection and middleware pipeline.
- High‑performance runtime with Kestrel server.
- Cross‑platform support (Windows, Linux, macOS).
- Integrated security, authentication, and authorization.
Quick Start
Run the following command to create a new ASP.NET Core web app:
dotnet new webapp -o MyWebApp
cd MyWebApp
dotnet run
Open https://localhost:5001
in your browser to see the starter app.
Sample Code: Hello World Controller
using Microsoft.AspNetCore.Mvc;
namespace MyWebApp.Controllers
{
[ApiController]
[Route("[controller]")]
public class HelloController : ControllerBase
{
[HttpGet]
public IActionResult Get() => Ok("Hello, ASP.NET!");
}
}
Visit /hello
after adding this controller to view the response.