Microsoft Developer Network

ASP.NET Core MVC Tutorials

Welcome to the ASP.NET Core MVC tutorial section. Learn how to build modern, data-driven, web applications using the Model-View-Controller (MVC) pattern with ASP.NET Core.

Getting Started

Core Features

Advanced Topics

Best Practices

Explore best practices for developing robust and maintainable ASP.NET Core MVC applications.

Example Snippet: A Simple Controller Action

Here's a look at a basic controller action in ASP.NET Core MVC:


using Microsoft.AspNetCore.Mvc;

namespace MyWebApp.Controllers
{
    public class HomeController : Controller
    {
        public IActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET Core MVC!";
            return View();
        }

        public IActionResult About()
        {
            ViewData["Title"] = "About Us";
            return View();
        }
    }
}