This section contains all micro samples for ASP.NET Core Razor Pages 2.2.
Pre-requisite: Make sure you download .NET Core SDK 2.2 (2.2.300
) otherwise below examples won't work.
-
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
. -
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.