Skip to content

Latest commit

 

History

History
 
 

razor-pages

Razor Pages (10)

Sections
Razor View (2)
  • 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.

  • Razor Pages Basic

    This sample shows the two approaches to Razor Pages, one with inline code behind and another with separate code behind.

  • Razor Pages and MVC Basic

    Compare and contrast on how the same task can be performed by using Razor Pages and MVC. This sample also shows you how to us Entity Framework Core In-Memory Database.

  • 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.

  • TempData backed by cookies

    Shows how to use TempData backed by coookies.

Handler Methods (1)

  • Get and Post

    This demonstrates the simplest usage for Get and Post handlers.

dotnet6