Sections |
---|
Razor View (2) |
This is the simplest example for Razor Page. Razor Page by default routes
.cshtml
files with@page
attribute under/Pages
. So/Pages/Index.cshtml
becomes/
and/Pages/AboutUs.cshtml
becomes/AboutUs
.This sample shows the two approaches to
Razor Pages
, one with inline code behind and another with separate code behind.Compare and contrast on how the same task can be performed by using
Razor Pages
andMVC
. This sample also shows you how to usEntity Framework Core
In-Memory Database.Use
@page
directive on your Razor Page file to customize the url of your Razor Page. Each Razor Page can only contain 1@page
definition.Capture routing data from
@page
url template usingRouteData.Values[]
.Customize HTML Id generated by Tag Helper
If you do not like the HTML Ids generated by Tag Helper, this sample shows you how to customize them.
Shows how to use
TempData
backed by coookies.
This demonstrates the simplest usage for
Get
andPost
handlers.
dotnet6