Razor vs MVC Razor for an ASP.NET Webforms developer

Jaco Pretorius 1 Reputation point


I have done extensive development on an ASP.NET Webforms system. The system is huge and speed is becoming an issue. I am looking into porting the system (or rewriting it). I am looking at MVC .NET Core with Razor or just Razor. My gutfeel says I have to learn MVC but it seems difficult. Razor seems an easier option but apparently not good for an interactive system. The two issues at hand are:


What is your opinion on the development route to follow? I am absolutely new to .NET core and MVC and razor.I have done some reading but I cannot find a definite answer. I would prefer the easiest route but as I mentioned speed is an issue and I do not want to regret my route in future.

Kind regards

Jaco Pretorius

A set of technologies in the .NET Framework for building web applications and XML web services.
3,145 questions
ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
550 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 36,026 Reputation points

    both MVC and Razor pages are the MVC pattern and have the same performance. The difference is the structure of the project.

    MVC has folder to define controller actions in, and a separate folder for the razor views. Each controller action build a model and picks a view to render.

    Razor pages allows defining the controller actions and the model in the view file itself, so the page actions do not need to select a view (its implicit). All the page actions are the same route, so must differ by request method (get, post, put, delete, etc). Razor pages also has the advantage of building page libraries where the controller code and razor code are bundled.

    MVC is considered mature, has only has new features that are shared with razor pages.

    Unless you are coming from a MVC background like old MVC or java spring (like myself), you should probably pick razor pages.

    0 comments No comments