Skip to content

Latest commit

 

History

History
21 lines (11 loc) · 985 Bytes

File metadata and controls

21 lines (11 loc) · 985 Bytes

Razor Pages (4)

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.

  • Hello World

    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.

  • Routing

    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.

  • Routing-2

    Capture routing data from @page url template using RouteData.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.