I'm Not Writing A Book On Razor Pages

5 (2 votes)

That's right - despite a number of questions, I am not writing a book on Razor Pages, the new page-based web development framework released as part of ASP.NET Core 2.0. But I have launched a web site for people who want to learn how to use ASP.NET Core Razor Pages.

The site is called learnrazorpages.com, and it provides a Razor Pages flavoured view of working with ASP.NET Core. I've been working on content for the site over the last few months and have enough to go live. The great thing about providing content in this way is that I am not subject to the deadlines of a book publisher, and can easily add more content and update existing content as and when I have time.

The current site content covers the basics of Razor Pages - what it is and where to get it. It also looks at the content and structure of a Razor Pages site along with taking a closer look at the following topics:

  • PageModels
  • Handler Methods
  • Tag Helpers
  • View Components
  • Configuration
  • Routing
  • Middleware
  • Working with forms
  • Model Binding
  • Validation
  • Working with Identity
  • Dependency injection
  • and more.

I plan to add many more articles covering a wide range of other topics, including working with data - cross referencing content at another site that I launched last year, learnentityframeworkcore.com. I am close to finishing the first of a series of walkthroughs which does this, and also covers some other more advanced topics including working with ViewModels and incorporating AutoMapper within a project.

Over time, the site will hopefully become a useful resource for anyone interested in migrating to ASP.NET Core who doesn't want to use MVC. The site itself is built using Razor Pages, and the content is stored in MarkDown files. I plan to release the source code for the site at some stage. In the meantime, if there is anything in particular that you would like to see the site cover, let me know by using the comments form at the bottom of this page.

Date Posted:
Last Updated:
Posted by:
Total Views to date: 2067

13 Comments

- Obinna Okafor

Thank you very much. I would like to see a project built from scratch using Razor Pages. And it should show how to integrate CSS framework and other JavaScript goodness.
Once more thank you.

- tangdf

http://www.learnrazorpages.com/security/request-verification#opting-out

services.AddMvc().AddRazorPagesOptions(o =>
{
o.ConfigureFilter(new IgnoreAntiforgeryTokenAttribute());
});

The extension method `ConfigureFilter` does not exist.

I think it should be:


services.AddMvc().AddRazorPagesOptions(options =>
{
options.Conventions.ConfigureFilter(new IgnoreAntiforgeryTokenAttribute());
});


The value of `__RequestVerificationToken` is different from the value of Cookie.

Sorry, my English is too poor! But I know you understand what I mean.

- Satyabrata Mohapatra

This is a great news!!!! Thanks

- aziz sallam

u are a great man

- hrboyce

Mike, First thanks for doing this but I have to ask, any chance you would consider converting one of the old WebPages sample sites like the Gallery site into RazorPages? I found the ASP to WebPages articles you did quite helpful and thought a similar example would help those of us still stuck in WebPages find our way to RazorPages.

- Mike

@Obinna

I am working on a walkthrough that shows that.

- Mike

@tangdf

Thanks. I've updated the relevant section.

- Mike

@hrboyce

I have downloaded all the WebMatrix sample sites and do indeed plan to produce Razor Pages versions of all of them in time. I might use the old classified site to produce migration articles from both classic ASP and Web Pages.

- Borut

Mike, is it possible that Web Pages and Razor Pages "live" together in one web application?

I have a project build on Web Pages and I don't want to invest a lot of time to upgrade it to Razor Pages.
Is it possible to continue work on existing Project - old Pages stay as it and for new Pages I start using Razor pages?

Thank you,

Borut

- Mike

@Borut

I'm afraid not. They run in completely different processes. I'm going through the same thing and am creating a new site. As I replace existing Web pages with Razor Pages equivalents, I redirect the user to the new site.

- Rolf Herbert

So is MS deprecating razor Web Pages..? Is it dead..? I wish they would stop killing things so quickly its like google.

- Thomas

There's a typo on this page: https://www.learnrazorpages.com/razor-pages/model-binding#binding-data-from-get-requests

[[BindProperty(SupportsGet = true)]
should be
[BindProperty(SupportsGet = true)]

- Mike

@Rolf

No. Web Pages has not been deprecated at all.

Recent Comments

Thomas 05/03/2018 00:59
In response to I'm Not Writing A Book On Razor Pages
There's a typo on this page: = true)] should be [BindProperty(SupportsGet = true)]...

Rolf Herbert 04/03/2018 19:25
In response to I'm Not Writing A Book On Razor Pages
So is MS deprecating razor Web Pages..? Is it dead..? I wish they would stop killing things so its...

Borut 17/02/2018 12:59
In response to I'm Not Writing A Book On Razor Pages
Mike, is it possible that Web Pages and Razor Pages "live" together in one web application? I a I...

hrboyce 09/02/2018 04:44
In response to I'm Not Writing A Book On Razor Pages
Mike, First thanks for doing this but I have to ask, any chance you would consider converting one of...

aziz sallam 07/02/2018 10:18
In response to I'm Not Writing A Book On Razor Pages
u are a great man...

Satyabrata Mohapatra 31/01/2018 11:36
In response to I'm Not Writing A Book On Razor Pages
This is a great news!!!! Thanks...

tangdf 30/01/2018 07:25
In response to I'm Not Writing A Book On Razor Pages
=> { o.ConfigureFilter(new IgnoreAntiforgeryTokenAttribute()); }); The extension method does...

Obinna Okafor 30/01/2018 04:02
In response to I'm Not Writing A Book On Razor Pages
Thank you very much. I would like to see a project built from scratch using Razor Pages. And it show...

rachida Dukes 31/10/2017 13:52
In response to Customising Identity in Razor Pages
Thanks again for this wonderful tutorial. I followed all the steps in this section called: Adding...

Rachida 31/10/2017 12:06
In response to Customising Identity in Razor Pages
Thanks very much for this wonderful tutorial, it helped a lot....