Posts

Showing posts from November, 2013

The ASP.NET MVC View Engine

View Engine in MVC 4 In general, view engine is combination of markup language and programming language. View engine is responsible to create HTML from the View. This is a two step process. ASP.Net supports multiple types of view engine such as: Razor, ASPX, Spark, Brail etc. Also, MVC provides flexibility for a custom view engine. Here, we will discuss about the view engine majorly in use. ASPX: This is like a traditional ASPX page embedded with the markup language which requires defining of opening and closing tag as syntax. Extension for ASPX is .aspx Syntax: <%: %> Example: <% : Html.Label( "Hello world!" ) %> Razor:   This is a powerful and more flexible view engine as compared to ASPX. The line of code starts with @ symbol and does not require closing tag. Extension for Razor is depends on programming language you have selected. For C#, its .cshtml, for VB.Net its .vbhtml and so on. Syntax: @ Example: @ Html.Label( "

Journey to ASP.NET MVC

Basics of ASP.NET MVC MVC – the Model View Controller is a framework where each component is loosely coupled with each other. MVC is not the alternate of ASP.Net web forms, but a separate framework that force to develop application in tier architecture. Whether to choose MVC framework or ASP.Net web form, it depends upon the requirement and time span. The points given below may help you to choose an appropriate technology for your requirements.  When to use ASP.NET MVC framework? When you want to develop SOA or 3-tier based application. MVC is code driven technology, when you want full control on behavior of application, this will be the better option. Since it is code driven, therefore it requires more time to develop and is beneficial in case of big project.When you need full control on markup language, Razor will be the most suitable and flexible. MVC is loosely coupled between components; therefore managing components for a project is easy. Loosely coup