Home Interview Questions and Answers MVC Interview Questions and Answers For Graduates Part-1

MVC-Diagram1.Breifly explain us what is ASP.Net MVC?
ASP.Net MVC is a pattern which is used to split the application’s implementation logic into three components i.e. models, views, and controllers.

2.Tell us something about Model, view and Controllers in Asp.Net MVC?
Model : It is basically a business entity which is used to represent the application data. Controller : The Request which is sent by the user always scatters through controller and it’s responsibility is to redirect to the specific view using View () method. View : it’s the presentation layer of ASP.Net MVC.

3.Do you know about the new features in ASP.Net MVC 4 (ASP.Net MVC4)?
Following are features added newly : Mobile templates Added ASP.NET Web API template for creating REST based services. Asynchronous controller task support. Bundling of the java scripts. Segregating the configs for ASP.Net MVC routing, Web API, Bundle etc.

4.How does the ‘page lifecycle’ of ASP.Net MVC works?
Below are the processed followed in the sequence –

App initializWhat is Separation of Concerns in ASP.NET ASP.Net MVCation
Routing
Instantiate and execute controller
Locate and invoke controller action
Instantiate and render view.

5.Explain the advantages of ASP.Net MVC over ASP.NET?
Provides a clean separation of concerns among UI (Presentation layer), model (Transfer objects/Domain Objects/Entities) and Business Logic (Controller).
Easy to UNIT Test.
Improved reusability of model and views. We can have multiple views which can point to the same model and vice versa.
Improved structuring of the code.

6.What is Separation of Concerns in ASP.NET ASP.Net MVC?
It is the process of breaking the program into various distinct features which overlaps in functionality as little as possible. ASP.Net MVC pattern concerns on separating the content from presentation and data-processing from content.

7.What is Razor View Engine?
Razor is the first major update to render HTML in ASP.Net MVC 3. Razor was designed specifically for view engine syntax. Main focus of this would be to simplify and code-focused templating for HTML generation. Below is the sample of using Razor:

@model ASP.Net MVCMusicStore.Models.Customer
@{ViewBag.Title = “Get Customers”;}
< div class=”cust”> <h3><em>@Model.CustomerName</<em> </<h3><div>

8.What is the meaning of Unobtrusive JavaScript? Explain us by any practical example.
This is a general term that conveys a general philosophy, similar to the term REST (Representational State Transfer). Unobtrusive JavaScript doesn’t inter mix JavaScript code in your page markup. Eg : Instead of using events like onclick and onsubmit, the unobtrusive JavaScript attaches to elements by their ID or class based on the HTML5 data- attributes.

9.What is the use of View Model in ASP.Net MVC?
View Model is a plain class with properties, which is used to bind it to strongly typed view. View Model can have the validation rules defined for its properties using data annotations.

10.What you mean by Routing in ASP.Net MVC?
Routing is a pattern matching mechanism of incoming requests to the URL patterns which are registered in route table. Class : “UrlRoutingModule” is used for the same process.

You may also like

Leave a Comment