0

I am still a beginner to MVC and I was trying to understand why developers seem to prefer Razor engine over WebForms engine in ASP.Net.

My question: Is it because Webforms engine is slower than Razor engine?

Personally, Webforms engine comes more easily to me because I have been coding in Webforms for the last 12 years.

Sunil
  • 20,653
  • 28
  • 112
  • 197
  • webforms and razor are two complete different flavours given by micrososft...in webforms we use server side controls with runat server attribute but in asp.net mvc(razor) we have only html controls and moreover asp.net mvc(razor) is faster then webforms.. – Kartikeya Khosla Aug 28 '14 at 04:16
  • [Refer this question](http://stackoverflow.com/questions/4019740/does-razor-syntax-provide-a-compelling-advantage-in-ui-markup) –  Aug 28 '14 at 04:16
  • @StephenMuecke, From reading the post you mentioned, Webforms engine is not slower than Razor engine, but Razor engine has some other benefits over Webforms engine. – Sunil Aug 28 '14 at 04:27

1 Answers1

1

Performance wise there should be no difference. The razor engine was developed to give a more concise syntax as explained in the question Does Razor syntax provide a compelling advantage in UI markup?. What will give you a performance boost is removing the unused view engines. For example if you use only razor, then in the Global.asax.cs file

// Remove view engines except razor
ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(new RazorViewEngine());
Community
  • 1
  • 1