You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per @wcski
I have already done the Razor pages tutorial. I am doing the MVC tutorial because the projects I will be working on at work are MVC and not Razor pages.
Reacted by Emily Smirle, Hein Behrens, Charlie Finlayson, Steve, chenjilan123, bbruthers, Joshua Head, Rafael Liendo, Victor Alves, Uzair Ali and 2 more
I have never worked with ASP.net Core before, but I prefer to start with a design (MVC) I'm familiar with to get to know the fundamentals of C# and ASP.net before plunging in Razer.
Reacted by rfbu, Wouter van Rij, Steve, Sentai, Diego Olvera, bbruthers, Victor Alves, Jimmy Gee, santosh4005, Advait Panchal and 7 more
I'm far more familiar with MVC. With that said, the instructions for the Razerpages are shown with Visual Studio for Windows. The tutorial that linked the razer instructions was a Visual Studio for Mac tutorial..
I have glanced over the razor pages tutorial. I think for beginners it is indeed better than the MVC one. However, as an experienced MVC developer and somebody who will have to help interns learn programming:
Razor Pages is a spiritual successor (fairly or not) of Web Forms, which we moved over from to MVC and the skepticism towards anything resembling web forms is still there,
Right now you kind of need to be able to develop both MVC5 and core, and there is no pages in MVC5,
It is easier to move to developing APIs after doing stuff in MVC rather than pages,
Myself having experience with MVC makes it that much easier to help teach it.
Overall, to me, Razor Pages is in a place where it is cool to know it, it may be cool to use it, but you absolutely need to know MVC anyway, so might as well start with that.
Keep up the good work!
Reacted by gyurisc, extrem23, Cosmin Mavrichi, Steven Hildreth, Gerkin, Erid Bejko, h2df, Ian Johnson, Adam Williams, Tengiz Tutisani and 60 more
Reacted by Lei Pan, Steven Moschidis and yu1185299482
The Razor Tutorial requires VS and I've only got VS Code installed right now. Also why do I need Razor pages I don't like papercuts. Also isn't it just more overhead if I'm using React or Angular or similar (I mean I know they're client side, but it's more bloat. Guess I should just use WebApi and react or whatever.
Reacted by dymo, Kelsey Osos, Therac255, 杨中科 and lavilaso
It was very pity for me that ASP.net core team introduced Razor page. As we know, Microsoft technology lost developer in last years. Why we introduce WF/WPF/WCF, and then tell that those technology out of date.
The WebForm, tell it was out, the "MVC is new thing", and currently, tell "MVC was out, Razor page is new thing", what about tomorrow? "Razor page is out, what is new thing?". The elder developers must continue study that "new" but not the key technology -- that is why a lot of .net developer transfer to Java, why not make some stable framework for developers?
secondary, we have a lot of optimizing or quickly developing framework on MVC framework, like ABP framework ect. If change to new razor page, the whole pattern should be refactored, that is sucks and waste a lot of resources.
Reacted by José Augusto Guimarães, gyurisc, geoffNoCode, extrem23, Razvan Predescu, Minh Thiện, Wade Bee, Ian Johnson, dymo, kean and 53 more
Razor pages is not MVC, is a block, post page style, a moving back to old .aspx style, it is dead!
MVC is Clean, is freedom, is easy to do App and easy to do live controls and you can do page style also.
I hate Razor Pages, it is old style with new clothes!
Reacted by gyurisc, Gerkin, Minh Thiện, Wade Bee, Ian Johnson, Adam Williams, Tengiz Tutisani, dymo, martinpetrovaj, Vladimír Gašpar and 30 more
Reacted by Antonio Maniero, Autonomy Rocks, Evan, Brad Patton, Marcos Borunda, Steve "Ardalis" Smith, Mintoj, martin1b, Randy Blackmond and Max Díaz
MVC is a clean and proven paradigm. While Razor page approach feels like a step backward. I also feel that MVC plays better when you want to support mobile clients or Angular and React in your app. Razor pages does not seem to offer any of that.
Maybe it would help developers if there would be explanations when to use Razor Pages and when MVC is appropriate. My guess is that Razor Pages can be good for developing small one-off internal tools and sites inside the enterprise and MVC is better for public facing web sites.
Reacted by dymo, n!pple, Lee Hearne, Josh, Nikola Pavlović, Danilo das Neves Dantas, Stanislav Prusac, JS, Diogo Nóbrega, Jerker Pihl and 19 more
Reacted by Miroslav Parvanov, Antonio Maniero, RegencySoftware, getprice, Steve "Ardalis" Smith, Sajad Samiizadeh, talldaniel, martin1b, Randy Blackmond, Rick Andy and 2 more
@davidfowl I must confess I didnot worked with Razor Pages yet. I just skimmed through the tutorial. It is hard for me to see why this approach is better than MVC. Razor pages really reminds me the old ASP.NET Webform approach
Reacted by Wade Bee, Tengiz Tutisani, dymo, CodeNotFound, dush-a, Danilo das Neves Dantas, jovz, Uzair Ali, bathetrade, Mani Gandham and 3 more
I'm developing web applications professionally for about 7 years and I had experience in Symfony and J2EE frameworks. there is an unwritten law about programming professional web applications, laws like tools you use for code editors, web servers , load balancers, in-memory storages, documentation ,and even in development methods such as standard design patterns (like abstract, DI , MVC, front controller...).
So , please note that if you want coders to move to Microsoft web development platforms , you have to offer more and respect the rules! we are developers, not users. You SHOULD NOT ignore standards for sake of ease of use. Razor IS NOT STANDARD in real-world developers world.
for example , some of developers common preferences are:
"Gnu/Linux" , "Unix", "Unix-likes" rather than "Microsoft Windows".
"Vim", "Sublime Text" ,"VS Code" or other code editors nor "Jetbrains IDEs" rather than "Visual Studio Enterprise" because of price and freedom.
"NGINX" or "APACHE" web servers rather than "IIS" or "Kestrel".
"MariaDB" / "MySQL" or "PostgreSQL" rather than "MS SQL".
That's why I personally prefer "MVC web app with Visual Studio Code on macOS or Linux" tutorial to others, because it makes sense as a standard way to do the job.
it's like users expectations in Microsoft Windows applications:
No windows user expects to see "Exit" option under the "Help" menu, they look for this option under the "File" menu!
Thank you for the docs!
Reacted by martinpetrovaj, n!pple, Rishab1988, Ognian Dantchev, George Chen, Stanislav Prusac, Timothy A Vertein, nsomaru, joaquinelio, lavilaso and 1 more
Reacted by Miroslav Parvanov, Sandor, Antonio Maniero, Juliano Leal Goncalves, Jari, Sven Glöckner, Hicham Boushaba, Martín La Rosa, Esteban Leandro Marín, jamesmcculloughOLT and 21 more
Clarification from my point of view, I am not against Razor Pages in anyway. All I am saying is if something is documented (Official Docs) in MVC then Razor Pages should have the same example.
I have written MVC, Angular, React apps and get the reasoning behind the concept of Razor Pages. Just make sure the docs for Razor Pages have parity with the MVC examples.
Razor Pages introduce what seems to be some magic in relation to models etc.. Make sure it is clear. I know it is not really magic, but it may seem that way to others. At first glance you feel as if you are giving something up.
return Page() is a little different than building up a model and returning return View(model)
A basic login temperature is not all these. You're taking it to the extreme. Microsoft has provided it since forever, why remove it?
they didn't owe you an accounts controller implementation
That's exactly the kind of mindset and danger that people needs to be aware of. They don't owe user anything. That's means people's invested time is not an important factor in their decision now or future on a particular new technology.
They didn't take away your ability to create a login function
It's not there by default, and it creates confusion by default. And in many occasions, it's not what you technically can or cannot do it, but the first impression it gives.
Maybe it's just me, I'd like a default mvc template to work with a C. Here I refer template as a MVP. By removing the C in the template, it's no longer a MVP that demonstrate the c at work.
Maybe I hijected the discussion with the template, which is more specific to me. Other people may not have this issue. But many of them have concerns for their own reasons.
Actually since you mentioned windows 10, isn't windows 10 showing this similar type of mentality and problem now? They just set a deadline and push everybody ahead of it. I'm curious to see what happens on the day of windows 7 end support, where there are still 30-40% machines running it.
you have no experience in MVVM and think RP...
I have experience in mvvm, not so in RP. I wasn't interested in RP until I Google why MVC template has no login controller, and it leads me to this thread.
The more I read of this thread of what people's feedback on RP, the more sense it makes to me. Using mvvm has its challenge in the backend dominated by MVC pattern.
whatever valuable insight that could have been provided in this debate is provided.
Many valuable insights provided in early responses, but not addressed, so people left. I'm here at this RP vs MVC thread due to googling the issue I encountered with the MVC template.
Heated discussion as it is, is because a lot of these are highly opinionated. That's why the discussion? Because there're different views?
Of course Microsoft has the final say, I'll just leave it at that.
Clarification from my point of view, I am not against Razor Pages in anyway. All I am saying is if something is documented (Official Docs) in MVC then Razor Pages should have the same example.
Agreed.
Razor Pages introduce what seems to be some magic in relation to models etc..
What part of it feels like magic?
return Page() is a little different than building up a model and returning return View(model)
The thing is, the page is the model. Since a page consists of a view and a view model, saying return Page() means exactly what it means. If you are used to specifying "return this view and send this model with it" it may feel like you've given up something, but you haven't. The concept of a page is complete on its own, so you just return a page that already has a model.
I tried an experiment and converted a Controller to Razor Pages in an app I am working on. Fairly big with multiple Area/Controllers.
Converting was easy. Had to change up the models. Overall was easy. One thing I notice when navigating to Razor Pages, they flicker/flash and the Controller provided Views do not.
Both RP and MVC are not SPAs (Single Page Applications). Both will 'flicker' as each page is a full HTTP request resulting in a new document. Your mileage on screen flicker will vary depending on rendering performance and http transport speed.
@Rick-Anderson Unfortunately I can't share the source. @EntityAdam Correct, Does this mean RP is a little slower?
Possibly has to do with the common Layout, I literally replaced only a Controller using the same Partials, View Components and Layout.
It is not a glaring difference, just a visible flash. The Controllers do not flash. This is on a local machine, real world the Controllers might flash as well.
@ccit-spence I'm not asking you to share the source. I'm sure that would have too much irrelevant complexity. MVC with controllers and views using the same view engine as Razor Pages.
No it does not necessarily mean RP is any slower. I would be very surprised if there was anything more than a nominal difference. It's all the same stuff under the hood, as MVC and RP share approx 80% of the code. In simple terms, I always expect screen flicker, however running local sometimes it is imperceptible. It is the nature of rendering server side. If you want no flicker, you'll require client side rendering.
An update for the flash I was noticing, the flash only happens when going between Controllers and Pages. Pages to Pages no flash and Controller to Controller no flash.
Guessing some sort of transition in View rendering when going between Controller and Pages?
@ccit-spence View rendering is server-side (producing HTML code). There will always be flickering on client-side unless you are doing SPA.
A bit into very specific browser case: even if RP is slower than MVC, it should not be reason for flickering. At least in my browser, if I click a link, browser won't clear the current page but the loading icon should start animating, until it receives the HTML (which, server-side rendering of the View is finished already), only then will it clears the page and draws the new HTML page. In short, flickering should happen after server has already finished it job.
Given that 'the separation of frontend and backend' is a popular development pattern, ASP.Net Core MVC has become unpopular, why we should go back to the old-styled coupling technology:Razor Pages?
Activity
Rick-Anderson commentedon Apr 30, 2018
Per
@wcskiI have already done the Razor pages tutorial. I am doing the MVC tutorial because the projects I will be working on at work are MVC and not Razor pages.
Staartvin commentedon May 2, 2018
I have never worked with ASP.net Core before, but I prefer to start with a design (MVC) I'm familiar with to get to know the fundamentals of C# and ASP.net before plunging in Razer.
dmillzilla commentedon May 4, 2018
I'm far more familiar with MVC. With that said, the instructions for the Razerpages are shown with Visual Studio for Windows. The tutorial that linked the razer instructions was a Visual Studio for Mac tutorial..
kshorod commentedon May 4, 2018
I have glanced over the razor pages tutorial. I think for beginners it is indeed better than the MVC one. However, as an experienced MVC developer and somebody who will have to help interns learn programming:
Overall, to me, Razor Pages is in a place where it is cool to know it, it may be cool to use it, but you absolutely need to know MVC anyway, so might as well start with that.
Keep up the good work!
racouster commentedon May 5, 2018
The Razor Tutorial requires VS and I've only got VS Code installed right now. Also why do I need Razor pages I don't like papercuts. Also isn't it just more overhead if I'm using React or Angular or similar (I mean I know they're client side, but it's more bloat. Guess I should just use WebApi and react or whatever.
Rick-Anderson commentedon May 5, 2018
@racouster The VS Code
meision commentedon May 8, 2018
It was very pity for me that ASP.net core team introduced Razor page. As we know, Microsoft technology lost developer in last years. Why we introduce WF/WPF/WCF, and then tell that those technology out of date.
The WebForm, tell it was out, the "MVC is new thing", and currently, tell "MVC was out, Razor page is new thing", what about tomorrow? "Razor page is out, what is new thing?". The elder developers must continue study that "new" but not the key technology -- that is why a lot of .net developer transfer to Java, why not make some stable framework for developers?
secondary, we have a lot of optimizing or quickly developing framework on MVC framework, like ABP framework ect. If change to new razor page, the whole pattern should be refactored, that is sucks and waste a lot of resources.
JAugustoGuimaraes commentedon May 10, 2018
Razor pages is not MVC, is a block, post page style, a moving back to old .aspx style, it is dead!
MVC is Clean, is freedom, is easy to do App and easy to do live controls and you can do page style also.
I hate Razor Pages, it is old style with new clothes!
gyurisc commentedon May 11, 2018
MVC is a clean and proven paradigm. While Razor page approach feels like a step backward. I also feel that MVC plays better when you want to support mobile clients or Angular and React in your app. Razor pages does not seem to offer any of that.
Maybe it would help developers if there would be explanations when to use Razor Pages and when MVC is appropriate. My guess is that Razor Pages can be good for developing small one-off internal tools and sites inside the enterprise and MVC is better for public facing web sites.
davidfowl commentedon May 11, 2018
@JAugustoGuimaraes @gyurisc have you used Razor Pages?
gyurisc commentedon May 11, 2018
@davidfowl I must confess I didnot worked with Razor Pages yet. I just skimmed through the tutorial. It is hard for me to see why this approach is better than MVC. Razor pages really reminds me the old ASP.NET Webform approach
JAugustoGuimaraes commentedon May 14, 2018
I start with Razor Pages at https://docs.microsoft.com/en-us/aspnet/core/security/authorization/secure-data?view=aspnetcore-2.1
rseyf commentedon May 15, 2018
I'm developing web applications professionally for about 7 years and I had experience in Symfony and J2EE frameworks. there is an unwritten law about programming professional web applications, laws like tools you use for code editors, web servers , load balancers, in-memory storages, documentation ,and even in development methods such as standard design patterns (like abstract, DI , MVC, front controller...).
So , please note that if you want coders to move to Microsoft web development platforms , you have to offer more and respect the rules! we are developers, not users. You SHOULD NOT ignore standards for sake of ease of use. Razor IS NOT STANDARD in real-world developers world.
for example , some of developers common preferences are:
That's why I personally prefer "MVC web app with Visual Studio Code on macOS or Linux" tutorial to others, because it makes sense as a standard way to do the job.
it's like users expectations in Microsoft Windows applications:
Thank you for the docs!
288 remaining items
ccit-spence commentedon Aug 28, 2019
Clarification from my point of view, I am not against Razor Pages in anyway. All I am saying is if something is documented (Official Docs) in MVC then Razor Pages should have the same example.
I have written MVC, Angular, React apps and get the reasoning behind the concept of Razor Pages. Just make sure the docs for Razor Pages have parity with the MVC examples.
Razor Pages introduce what seems to be some magic in relation to models etc.. Make sure it is clear. I know it is not really magic, but it may seem that way to others. At first glance you feel as if you are giving something up.
return Page()is a little different than building up a model and returningreturn View(model)Keeping the files close together is a great idea.
arisliang commentedon Aug 28, 2019
A basic login temperature is not all these. You're taking it to the extreme. Microsoft has provided it since forever, why remove it?
That's exactly the kind of mindset and danger that people needs to be aware of. They don't owe user anything. That's means people's invested time is not an important factor in their decision now or future on a particular new technology.
It's not there by default, and it creates confusion by default. And in many occasions, it's not what you technically can or cannot do it, but the first impression it gives.
Maybe it's just me, I'd like a default mvc template to work with a C. Here I refer template as a MVP. By removing the C in the template, it's no longer a MVP that demonstrate the c at work.
Maybe I hijected the discussion with the template, which is more specific to me. Other people may not have this issue. But many of them have concerns for their own reasons.
Actually since you mentioned windows 10, isn't windows 10 showing this similar type of mentality and problem now? They just set a deadline and push everybody ahead of it. I'm curious to see what happens on the day of windows 7 end support, where there are still 30-40% machines running it.
I have experience in mvvm, not so in RP. I wasn't interested in RP until I Google why MVC template has no login controller, and it leads me to this thread.
The more I read of this thread of what people's feedback on RP, the more sense it makes to me. Using mvvm has its challenge in the backend dominated by MVC pattern.
Many valuable insights provided in early responses, but not addressed, so people left. I'm here at this RP vs MVC thread due to googling the issue I encountered with the MVC template.
Heated discussion as it is, is because a lot of these are highly opinionated. That's why the discussion? Because there're different views?
Of course Microsoft has the final say, I'll just leave it at that.
AgentTheGreat commentedon Aug 28, 2019
Agreed.
What part of it feels like magic?
The thing is, the page is the model. Since a page consists of a view and a view model, saying
return Page()means exactly what it means. If you are used to specifying "return this view and send this model with it" it may feel like you've given up something, but you haven't. The concept of a page is complete on its own, so you just return a page that already has a model.ccit-spence commentedon Aug 29, 2019
I tried an experiment and converted a Controller to Razor Pages in an app I am working on. Fairly big with multiple Area/Controllers.
Converting was easy. Had to change up the models. Overall was easy. One thing I notice when navigating to Razor Pages, they flicker/flash and the Controller provided Views do not.
Is this normal?
Rick-Anderson commentedon Aug 29, 2019
I've never heard of that from folks who converted. @ccit-spence Can you provide a sample on GitHub that reproduces the problem?
EntityAdam commentedon Aug 29, 2019
Both RP and MVC are not SPAs (Single Page Applications). Both will 'flicker' as each page is a full HTTP request resulting in a new document. Your mileage on screen flicker will vary depending on rendering performance and http transport speed.
ccit-spence commentedon Aug 29, 2019
@Rick-Anderson Unfortunately I can't share the source.
@EntityAdam Correct, Does this mean RP is a little slower?
Possibly has to do with the common Layout, I literally replaced only a Controller using the same Partials, View Components and Layout.
It is not a glaring difference, just a visible flash. The Controllers do not flash. This is on a local machine, real world the Controllers might flash as well.
Rick-Anderson commentedon Aug 29, 2019
@ccit-spence I'm not asking you to share the source. I'm sure that would have too much irrelevant complexity. MVC with controllers and views using the same view engine as Razor Pages.
EntityAdam commentedon Aug 30, 2019
No it does not necessarily mean RP is any slower. I would be very surprised if there was anything more than a nominal difference. It's all the same stuff under the hood, as MVC and RP share approx 80% of the code. In simple terms, I always expect screen flicker, however running local sometimes it is imperceptible. It is the nature of rendering server side. If you want no flicker, you'll require client side rendering.
ccit-spence commentedon Aug 31, 2019
An update for the flash I was noticing, the flash only happens when going between Controllers and Pages. Pages to Pages no flash and Controller to Controller no flash.
Guessing some sort of transition in View rendering when going between Controller and Pages?
datvm commentedon Aug 31, 2019
@ccit-spence View rendering is server-side (producing HTML code). There will always be flickering on client-side unless you are doing SPA.
A bit into very specific browser case: even if RP is slower than MVC, it should not be reason for flickering. At least in my browser, if I click a link, browser won't clear the current page but the loading icon should start animating, until it receives the HTML (which, server-side rendering of the View is finished already), only then will it clears the page and draws the new HTML page. In short, flickering should happen after server has already finished it job.
sfatali commentedon Jan 12, 2020
Yeah, because of this kind of lame "design features" I shall never touch Razor Pages again! dotnet/aspnetcore#8065
yangzhongke commentedon Apr 1, 2020
Given that 'the separation of frontend and backend' is a popular development pattern, ASP.Net Core MVC has become unpopular, why we should go back to the old-styled coupling technology:Razor Pages?