ASouthorn
ASouthorn

Reputation: 399

Is there a reason that cshtml isn't popular

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

Upvotes: 6

Views: 2123

Answers (3)

Display Name
Display Name

Reputation: 4732

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

Upvotes: 1

Mike Brind
Mike Brind

Reputation: 30065

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.

Upvotes: 3

Brad Christie
Brad Christie

Reputation: 101614

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).

Upvotes: 5

Related Questions