“View Engine in ASP.NET MVC is used to translate our views to HTML and then render to browser.”
There are few View Engines available for ASP.NET MVC but commonly used View Engines are Razor, Web Forms/ASPX, NHaml and Spark etc. Most of the developers are familiar with Web Forms View Engine (ASPX) and Razor View Engine.
There are few View Engines available for ASP.NET MVC but commonly used View Engines are Razor, Web Forms/ASPX, NHaml and Spark etc. Most of the developers are familiar with Web Forms View Engine (ASPX) and Razor View Engine.
- Web Form View Engine was with ASP.NET MVC since beginning.
- Razor View Engine was introduced later in MVC3.
- NHaml is an open source view engine since 2007.
- Spark is also an open source since 2008.
public ActionResult About() { return View(); }
Some Types=>>
1) Web Form Engine is the default view engine for the Asp.net MVC that is included with Asp.net MVC from the beginning.
2).The namespace for Webform Engine is
System.Web.Mvc.WebFormViewEngine
.
3).The file extensions used with Web Form Engine are also like Asp.net Web Forms. It has .aspx extension for views, .ascx extension for partial views & editor templates and .master extension for layout/master pages.
4).Web Form Engine has the same syntax like Asp.net Web Forms uses for .aspx pages.
5).Web Form syntax are borrowed from Asp.net Web Forms syntax that are mixed with html and s sometimes make a view messy. Webform uses <% and %> delimiters to make the code like as:
- <%: Html.ActionLink("SignUp", "SignUp") %>
No comments:
Post a Comment