locked
Which one to choose between DotNet Core MVC or Razor Pages for the future RRS feed

  • Question

  • User197122282 posted

    I am shifting to DotNet Core and can see the options of using both Core MVC or Razor Pages

    Both have their differences amongst many. Core MVC is suitable for API Calls/Complex applications whereas Razor Pages are suitable for HTML Views.

    My question is do we expect one standard to dominate in the future or both will run in parallel? In the later option, we have to master both programming styles.

    Thanks.

    Thursday, August 15, 2019 8:22 AM

Answers

  • User-821857111 posted

    Razor Pages is the recommended framework for server-side HTML generation. It might eventually end up being more popular than MVC. Technically, it is just as powerful and flexible as MVC (with a few quirks) but it suffers from some perception issues, not helped by the poor organisation of relevant documentation from Microsoft. Razor Pages is for complex applications, too.

    MVC is well known. It is a lot easier to port existing MVC applications to MVC Core than to Razor Pages, although conversely, it is a lot easier conceptually to move from Web Forms to Razor Pages than to MVC Core. 

    Razor Pages use is growing (if the increasing traffic to my web site https://www.learnrazorpages.com is anything to go by), but MVC is likely to dominate through sheer inertia if nothing else.

    You should learn both.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 15, 2019 9:04 AM
  • User-821857111 posted

    One thing I would like to ask here is about the classic ASP.NET web pages. Is it safe to assume that these will be obsolete in the future and there is no need to invest further in these?
    Obselete in respect of software has a specific meaning. Since it is part of .NET 4.8, the Web Pages framework will be supported all the time that .NET 4.8 is. Therefore it will not be obselete for some considerable time. But you won't see any new features added to ASP.NET Web Pages. 

    I have used Web Pages, and I wouldn't consider using it for any future projects. Razor Pages is a significantly better option. I have one large Web Pages application left which I will be migrating to Razor Pages as soon as I have the resources. All the others have already been replaced by Razor Pages.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 19, 2019 1:07 PM

All replies

  • User-821857111 posted

    Razor Pages is the recommended framework for server-side HTML generation. It might eventually end up being more popular than MVC. Technically, it is just as powerful and flexible as MVC (with a few quirks) but it suffers from some perception issues, not helped by the poor organisation of relevant documentation from Microsoft. Razor Pages is for complex applications, too.

    MVC is well known. It is a lot easier to port existing MVC applications to MVC Core than to Razor Pages, although conversely, it is a lot easier conceptually to move from Web Forms to Razor Pages than to MVC Core. 

    Razor Pages use is growing (if the increasing traffic to my web site https://www.learnrazorpages.com is anything to go by), but MVC is likely to dominate through sheer inertia if nothing else.

    You should learn both.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 15, 2019 9:04 AM
  • User1289604957 posted

    Hi,

    My question is do we expect one standard to dominate in the future or both will run in parallel?

    Both will run in parallel. Razor Pages is an MVC technology without a lot of ceremony.

    Best regards,

    Maher

    Thursday, August 15, 2019 9:06 AM
  • User711641945 posted

    Hi kashifdotnet,

    Razor Page is  provide a simpler way to organize code within ASP.NET Core applications, keeping implementation logic and view models closer to the view implementation code.

    MVC  has existed for a long time, it pays attention to the distinction of function.Razor Page pays more attention to the distinction of purpose. 

    They are subtly different, it’s hard to say which is better.And they could run in parallel.

    Best Regards,

    Rena

    Thursday, August 15, 2019 10:09 AM
  • User-821857111 posted

    MVC  has existed for a long time, it pays attention to the distinction of function.Razor Page pays more attention to the distinction of purpose. 
    What does that mean?

    Thursday, August 15, 2019 10:11 AM
  • User475983607 posted

    I use both Razor Pages and MVC/API.  Razor pages generate the initial HTML and JavaScript applications call API endpoints to update the DOM.  While Razor Pages can do the same I prefer this method.

    In short, I agree that you should learn MVC and Razor Pages.

    Thursday, August 15, 2019 11:11 AM
  • User-474980206 posted

    MVC implements a popular web pattern implemented by many frameworks. Those that know the pattern generally prefer to stay with it. Those coming from a jsp or webforms background may prefer razor pages. 

    I've used MVC since version 3, but would consider switching to razor pages, but currently I don't need either, just WebApi and a static page hosting the javascript client application. 

    Thursday, August 15, 2019 3:54 PM
  • User-1209166642 posted

    Funny someone mentioned jsp.  I programmed java (servlets, jsp, beans) for years, and you could easily go either way.

    1. Heavy servlet and jsp page similar to razor pages.
    2. Queries in class (bean) which servlet called and pass to jsp page.

    But so far I like razor pages better than the full blown mvc.

    But remember, as was in web pages, even in razor pages you are still free to write custom classes as needed.

    Saturday, August 17, 2019 12:04 AM
  • User197122282 posted

    Mikesdotnetting

    You should learn both.

    Mike, the above summarizes the discussion.

    One thing I would like to ask here is about the classic ASP.NET web pages. Is it safe to assume that these will be obsolete in the future and there is no need to invest further in these?

    Sunday, August 18, 2019 4:55 AM
  • User475983607 posted

    One thing I would like to ask here is about the classic ASP.NET web pages. Is it safe to assume that these will be obsolete in the future and there is no need to invest further in these?

    Only if you wish to increase your marketability.

    Sunday, August 18, 2019 10:52 AM
  • User-821857111 posted

    One thing I would like to ask here is about the classic ASP.NET web pages. Is it safe to assume that these will be obsolete in the future and there is no need to invest further in these?
    Obselete in respect of software has a specific meaning. Since it is part of .NET 4.8, the Web Pages framework will be supported all the time that .NET 4.8 is. Therefore it will not be obselete for some considerable time. But you won't see any new features added to ASP.NET Web Pages. 

    I have used Web Pages, and I wouldn't consider using it for any future projects. Razor Pages is a significantly better option. I have one large Web Pages application left which I will be migrating to Razor Pages as soon as I have the resources. All the others have already been replaced by Razor Pages.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 19, 2019 1:07 PM
  • User197122282 posted

    I have used Web Pages, and I wouldn't consider using it for any future projects. Razor Pages is a significantly better option. I have one large Web Pages application left which I will be migrating to Razor Pages as soon as I have the resources. All the others have already been replaced by Razor Pages.

    I have also played around MVC Core and Razor Pages and both are promising. It really comes down to a choice of preference though both have slight advantages.

    Mike, thanks for the expert opinion and insight into what others are using. Cleared my doubts.

    Tuesday, August 20, 2019 2:46 PM