Razor Pages, really?


#1

Hi guys,

https://docs.microsoft.com/en-us/aspnet/core/mvc/razor-pages/?tabs=visual-studio

it is only my point of view or it is a revamped MVVM like webform? (onGet instead of PageLoad).
Was it really necessary have a double way to write a web application?

How many time before find solution mixed like the WebForm and MVC?
What do you think?

Thank you,
Mauro


#2

I don’t think that the RazorPages are anything like WebForms. From my understanding the RazorPages use the Controller Principle but for one page only. So instead of creating a Contact Controller and creating the Index method and the Post of the form. You create a unified Razor file with a backing cs class that will handle get, post, put, patch, delete HTTP Verbs.
So from my point of view the OnGet is just your index method.


#3

Thank you!
So a kind of MVVM on top of the current MVC implementation to fast develop small projects.

Another interesting article
https://stackify.com/asp-net-razor-pages-vs-mvc/


.NET Foundation Website | Blog | Projects | Code of Conduct