- Getting Started
- Introduction
- Why ASP.NET Core?
- What Is ASP.NET Core?
- Installing ASP.NET Core?
- Hello World!
- Installing Visual Studio
- Creating a Project with Visual Studio
- Serving Your First File
- Summary
- HTML5 and CSS Basics
- Introduction
- What is HTML?
- HTML Basics
- HTML Forms
- CSS Basics
- CSS Naming
- The Box Model
- Summary
- Getting Started with JavaScript
- Introduction
- What is JavaScript?
- Add a JavaScript File
- JavaScript Events
- Using NPM (Node Package Manager)
- Introducing jQuery
- Practical jQuery
- Summary
- Using ASP.NET MVC
- Introduction
- What is MVC?
- First Controller/View
- Enabling MVC 6
- Creating a Layout
- Adding More Views
- Using Tag Helpers
- Razor Pages
- Implementing a Contact Page
- Model Binding
- Using Validation
- Adding a Service
- Summary
- Using Bootstrap to Prototype the App
Using ASP.NET MVC
Introduction
- Supporting MVC 6 in ASP.NET Core
- Creating Controllers
- Creating Views and Layouts
- Using Model Validation
- Tag Helpers
Model - View - Controller
- Controller - The Logic of the App
- Model - the data
- View - Renders Data
- Create a controller called AppController.cs derives from Controller
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DutchTreat.Controllers
{
public class AppController : Controller
{
public IActionResult Index()
{
//throw new InvalidOperationException("Bad things happened");
return View();
}
}
}