Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disadvantages of the ASP.net MVC Webforms View Engine?

I'm planning a new project at the moment, built on MVC. Now, there are several different View Engines, and I just wonder what the disadvantages of the Webforms engine are that would justify a switch? Some people feel really strong against it, and I just wonder why?

Can I still retain something like .ascx Controls with other View Engines, say Spark or StringTemplate? (Okay, to be fair, that's just using RenderPartial and passing in proper ViewData, but it's still modularization of common "blocks" on multiple views)

like image 284
Michael Stum Avatar asked Apr 30 '09 15:04

Michael Stum


People also ask

What is ASP.NET and its advantages and disadvantages?

ASP.NET delivers enhanced performance and scalability. It also comes with features like just-in- time compilation, early binding, native optimisation and caching services, and they too serve to improve performance several notches higher. The codes here are not interpreted like traditional ASP pages.

What are the disadvantages of .NET core?

ASP.NET Core ConsIt will take a few years till existing products based on . NET Core will be fully updated. Though there are a lot of . NET developers on the market, ASP.NET Core framework is a huge step forward comparing to ASP.NET Framework and there are many changes and new concepts.


3 Answers

From my experience the only real disadvantage of the webforms engine is verbosity. Spark is much more terse and supports partials (not .ascx though) and master pages.

You can run Spark and the standard webforms engine side by side though so if you run into any cases where spark wouldn't work for you, you could still use webforms (I don't know of a way to share master pages between them though).

like image 110
John Sheehan Avatar answered Sep 20 '22 22:09

John Sheehan


Stephen Walther has a couple of examples of using a different view engine than the webforms engine with MVC:

  • ASP.NET MVC Tip #19 – Use the nVelocity View Engine
  • ASP.NET MVC Tip #35 – Use the NHaml View Engine

As far as advantage vs. disadvantage... I personally enjoy the "tag soup" feel of classic asp'ish style. To me, it feels like an old comfortable pair of shoes.

With judicious use of HtmlHelpers, the tag soup is greatly reduced by having reusable "bits". In classic ASP, I made class helpers and included them in the page. In webforms, I rolled web controls. Now it's HtmlHelpers.

like image 44
datacop Avatar answered Sep 21 '22 22:09

datacop


I think the MVC view engine isnt that bad. I also like sticking with the "mainstream" as I am sure there will be new features/help in MVC 2.0 that I dont want to miss out. I am sure the other engines do some very nice things, but everytime I have strayed from the standard, its managed to find me when we want ot upgrade to the next technology or release.

However, that said - the only true way to understand what those other engines provide is to try them out with somehting you have build or understood and see if you like the feel and or capabilities that you are gaining/giving up.

like image 31
MikeJ Avatar answered Sep 21 '22 22:09

MikeJ