View Engines MVC

By Default MVC project enable both engines “Web Form” & “Razor”. In some case we doesn’t really care either we using .aspx, .ascx, .cshtml or .vbhtml it’s will just work by itself.

ViewEnginesByDefault

When you enable both of the Engines the performance will be affect, since it’s will figure out the Web Form Engines first then the Razor Engines.

If you exactly know you going to used only Razor Engines, it’s good sign to j^st enable one of the Engines, since it’s will bring performance improvement as well. to enabled Razor Engine simple in your “Global.asax.cs” and put this line of code”

ViewEngines.Engines.Clear(); //remove all view engines
ViewEngines.Engines.Add(new RazorViewEngine()); //We j^st enable the Razor Engine in here.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s