Is there a reason that cshtml isn't popular
Asked Answered
A

3

6

Firstly, I have only recently tried my hand at building with razor in cshtml using Webmatrix and I found it much less time consuming than building aspx web forms. Having gotten used to it, I can now do all the things I used to do inside my aspx projects much quicker and with much less code...

Now, I've spent today looking around google etc at companies using cshtml, what they're using it for etc, but I can't find a large range of examples out there. Maybe I was just looking in the wrong place, rendering this question title incorrect, but I just had a feeling that there is a reason why companies are still using aspx over cshtml.

I'm about to start a project next month for a big client and I can't decide whether to take the step of building it this way (they need a custom blog, login area etc). Any thoughts? The only other stack thread I found of any use with regards to a debate was: Razor/CSHTML - Any Benefit over what we have?

Thanks,

Adam

Appalachia answered 24/9, 2012 at 18:19 Comment(0)
K
5

A lot of it has to do with ASP (classic) has been around a lot longer and (depending the project size) a migration can incur too much cost.

There's also considerations like:

  1. What does the current web staff know (what are they fluent in?)
  2. What libraries (proprietary or otherwise) are already dependent on ASP (including custom controls).
  3. How much of an SEO hit are you going to take converting (some sites can mimic classic aspx page suffixes by just changing the way the routes behaving but are in-fact using cshtml).
Kesterson answered 24/9, 2012 at 18:23 Comment(1)
Ah I thought as much, especially just being due to migration costs. But if there's nothing specific in regards to loss of functionality or security etc then I don't see any negatives in using it. Rejoice! Thanks BradAppalachia
O
3

There isn't a compelling reason for experienced ASP.NET developers to move from Web Forms or MVC to Web Pages (Razor). As a framework, it is designed to attract those who might find Web Forms or MVC too much of a learning curve. Those coming from Classic ASP or PHP, for example.

I answer a lot of questions on the Web Pages framework over at the ASP.NET forums, and I have definitely seen an increase in the number of people trying the framework out. In terms of functionality and security, you have the whole ASP.NET framework behind you so you can do anything with Web Pages that you can do with MVC or Web Forms - a lot of it more easily.

The Web Pages framework is not designed with testability in mind, and it may be more difficult for teams to organise since a certain amount of server-logic is embedded in the same file as HTML.

If you are a lone developer and happy using Web Pages, go for it.

Ordonez answered 24/9, 2012 at 18:54 Comment(3)
Cheers Mike, makes sense. Interesting that its not ideal for teams though, I'll keep that in mindAppalachia
@Appalachia I don't think his point was that it's not ideal for teams, but that if your team is already versed in Web Forms then moving to MVC will require the entire team to get up to speed on it. MVC works fine for teams. On a team of 5 using MVC and I don't think any of us would ever willingly go back to Web Forms. I know this is old question but wanted to throw my 2 cents in there for anyone coming across this.Augustusaugy
@Appalachia My point was exactly that the Web Pages framework is not ideal for teams. MVC is not Web Pages. They are two different development frameworks.Ordonez
C
1

There been a lot of discussion about the topic. Its just opinions, right tool for the right job. Please look into the following for opinions & answers:

Hope this helps

Cressi answered 24/9, 2012 at 19:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.