ASP.NET MVC Interview Questions and Answers Part 3

1.) What are the features of ASP.NET MVC 3 Template ?                                                
  • mvc was released on january 13 ,2011
  • It runs on .NET Framework 4.0 and with visual studio 2010 and above.
  • It uses Razor as a default view engine.but you can use ASPX or web form view engine also.
  • It helps in remote validation.
  • It provides compare attribute.
  • It enhanced in DataAnnotations  attributes for model validation on client and server sides.
  • It supports compare attribute.
  • It act as a dependency resolver.
  • It helps partial -page output caching.
  • It uses View Bag dynamic property for passing data from controller to view.
  • It supports Global action features also.
  • It support child action Output caching.
  • It uses NuGet to deliver software and manage dependency through the platform.
  • It support Entity framework codes.
  • It provide better java script support in template.
  • etc.
2.) What are advantages of ASP.NET MVC  ?                                                                        
There are following advantage of mvc as given below.
  • mvc has three main components model,view and controller which make it easier to manage the application complexity.
  • Application developers has full control on behavior of mvc application.
  • An mvc application is more pluggable and extensible.We can customize it easily.
  • application supports following features such as Application Arcitecture model, authentication and authorization,roles and membership,caching and session etc.
  •  Mvc framework supports a powerful URL Routing mechanism that helps to build a good application.
  • The mvc framework provide better support to test driven development (DDD).
  • mvc framework helps in search engine optimization also.     

3.) What are default view engine in ASP.NET MVC  ?                                                       
There are two default view engine in mvc as given below:-
  1. ASPX (Web Form)
  2. Razor
 4.) Can we remove default view engine in ASP.NET MVC and how  ?                        
Yes, we can use following codes as given below:-
protected void Application_Start()  

5.) What are view engines ?                                                                                                         
 A View Engine is a MVC Subsystem which is responsible for rendering the view into HTML form to the Browser(Chrome,Internet Explorer,Firefox etc.).
6.) What are the default view engines used in mvc ?                                         
  • Spark
  • Nhamal
  • Hasic
  • NDango
  • Bellevue 
  • Brail etc.
7.) How does a  view engine work ?                                                                                          
Each view engine (open source,non open source) has using following components as given below:-
  • View Engine Class :-  This class implements the IViewEngine interface and responsible for locating view templates.You can see this class,when you will develop any  ASP.NET MVC application.
  • View Class :- This class implements the IViewEngine Interface and responsible for combing the template with data from the current context. This convert it to HTML Mark up as a output.
  • Template Parsing engine :- The View Engine parse the template and compiles the view executable code.
Note :-  You can use multiple view engine for your ASP.NET MVC application.
8.) What is ASPX view engine  ?                                                                                                 
  • This default view engine for MVC 1 and MVC 2 template. 
  • This view engine uses same syntax as web forms uses .
  • It uses file extension (.aspx,ascx,.master etc.) as web forms. 
  • It uses <% %> character for data binding purpose.
9.) What is Razor view engine  ?                                                                                                
  • Razor View Engine is an advanced view engine ,that was introduced Microsoft in MVC 3 template. 
  • Razor is a default view engine in MVC 3 and MVC 4 template.
  • Razor is a new markup syntax developed by Microsoft.
  •  Razor uses @ character to write the markup syntax.
  • Razor is more compact than other view engine.
  • Razor is a best view engine developed by Microsoft.
  • Razor is more compatible with unit testing.
  • Razor uses less codes to bind the data in mvc template.
  • Razor is very easy and much clean web form syntax. 
10.) Can we share a view engine across multiple platform ?                                        
Yes, It is possible by putting a view into the share folder.

11.) What is  URL Routing and URL Rewriting ?                                                               
  • URL Routing is focused on mapping a URL to a resource while URL rewriting is focused on mapping one url (new url) to another url (old url).
  • URL routing map to the original route while URL rewriting rewrites your old url to new one but routing is not like that. 


Post a Comment

Powered by Blogger.