Razor vs MVC Razor for an ASP.NET Webforms developer

Jaco Pretorius 6 Reputation points
2021-09-15T07:05:50.153+00:00

Hello!

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:

Speed
Ease

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

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,135 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,243 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 54,866 Reputation points
    2021-09-15T15:35:21.34+00:00

    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