# What is ASP.NET Core

ASP.NET Core is .NET's framework for the web. It listens for requests, runs your C# to answer each one, and sends back a page built for that request.

Novice · ASP.NET Core · Web Development · Updated November 15, 2026

By Gregor Dzierzon

## After this lesson you can

- Explain what ASP.NET Core does when a browser asks for a page
- Tell a static website from a dynamic one, and name the kinds of app ASP.NET Core builds

## Key takeaways

- A static website sends the same file to everyone; a dynamic website builds each page with code when the request arrives.
- ASP.NET Core listens for a request, reads it, runs the C# that answers that address, and sends back the response. You write the C#.
- Kestrel, ASP.NET Core's built-in web server, waits for requests on your app's port.
- An MVC app sends back whole HTML pages; a Web API sends back data, as JSON, for another program to show.

The pages you built with HTML, CSS and Bootstrap were **static**: each page was a file, and the server sent that file to anyone who asked, the same every time. A bookstore can't work that way. Its pages show what's in the database *right now*: today's prices, the books in stock, *your* order.

Pages like that are **dynamic**: a program builds each one when the request arrives. **ASP.NET Core** is how you write that program in C#.

## A framework for the web

ASP.NET Core is a **framework**: a large set of ready-made code that does the common work of every web app, so you write only what's special about yours. It comes with .NET, so there's nothing extra to install.

When a browser asks for a page, ASP.NET Core:

1. **Listens** for the request. Its built-in web server, **Kestrel**, waits on your app's port.
2. **Reads** the request: the address, the query string, any form data.
3. **Picks the C# code** that answers that address, and runs it. That's the part you write.
4. **Sends back** the response, usually HTML, then waits for the next request.

You write step 3. ASP.NET Core does the rest.

## Static or dynamic

| Static website | Dynamic website |
|---|---|
| Each page is a file on the server | Each page is built by code when it's requested |
| Everyone gets the same page | Pages can show data from a database, or depend on who's signed in |
| To add a page, add a file | To add a hundred product pages, write one page that takes the product's id |
| `products/tablet.html` | `Products/Details/7`, `Products/Details/8`, ... |

## What ASP.NET Core builds

ASP.NET Core can build several kinds of app. This course uses two:

| Kind | What it sends back | In this course |
|---|---|---|
| **MVC** (Model-View-Controller) | Whole HTML pages | Now: the next chapters build MVC apps |
| **Web API** | Data, as JSON, for another program to show | Later, behind an Angular front end |
| Razor Pages | Whole HTML pages, one file per page | Not covered: a simpler style of MVC |
| Blazor | Interactive pages written in C# | Not covered |

MVC and Web API apps share most of their parts, so what you learn about controllers now carries straight over to APIs.

## Do it: build a product's page with code

A static site needs one file per product. A dynamic site has one piece of C# that builds the page for whichever product was asked for, from the data as it is right now. Write that piece for NorthwindWeb's product page: it takes a product's values and returns the page's HTML as text.

The method gets three values:

- `name`: the product's name, a `string` (`"Chai"`).
- `price`: its price, a `decimal` (`18.00m`).
- `unitsInStock`: how many are in stock right now, an `int` (`39`).

For example, for Chai at $18.00 with 39 in stock, the page is built in three parts:

| Part | From | Becomes |
|---|---|---|
| The heading | `name`: `"Chai"` | `<h1>Chai</h1>` |
| The price | `price`: `18.00m`, with two decimal places | `<p>Price: $18.00</p>` |
| The stock | `unitsInStock`: `39` | `<p>39 in stock</p>` |

So `ProductPage("Chai", 18.00m, 39)` returns this one string, with nothing between the tags:

```text
<h1>Chai</h1><p>Price: $18.00</p><p>39 in stock</p>
```

**Your job:** write the method `ProductPage(string name, decimal price, int unitsInStock)` so it returns the page's HTML, a `string`.

- First the heading: the name between `<h1>` and `</h1>`.
- Then the price: `<p>Price: $`, the price with exactly two decimal places, and `</p>`.
- Then the stock: `<p>`, the number in stock, a space, `in stock`, and `</p>`.
- When `unitsInStock` is `0`, the stock part is `<p>Out of stock</p>` instead.
- No spaces or line breaks between the parts.

Practiced live on the lesson page: write the C# right there and check it.

## Check yourself

2 questions to try on the lesson page.

## So what

ASP.NET Core does the plumbing of the web (listening, reading requests, sending responses) so your C# can focus on one question: what should this page show? Next, you'll make your first MVC project and watch it answer.

## Key terms

- [ASP.NET Core](https://www.ask-codey.com/glossary/aspdotnet-core)
- [Framework](https://www.ask-codey.com/glossary/framework)
- [Dynamic Website](https://www.ask-codey.com/glossary/dynamic-website)
- [Kestrel](https://www.ask-codey.com/glossary/kestrel)

## Cheat sheets

- [What is ASP.NET Core](https://www.ask-codey.com/cheat-sheets/aspnet-core-what-is-aspnet-core-cheat-sheet)

Source: https://www.ask-codey.com/lessons/aspnet-core-what-is-aspnet-core
