Skip to main content

Asp .net MVC Questions and Answers-1

Asp .net MVC Questions and Answers

Asp .net MVC Questions and Answers

1) Explain what is Model-View-Controller?
MVC is a software architecture pattern for developing web application. It is handled by three objects Model-View-Controller.

2) Mention what does Model-View-Controller represent in an MVC application?
In an MVC model,
Model– It represents the application data domain. In other words applications business logic is contained within the model and is responsible for maintaining data
View– It represents the user interface, with which the end users communicates. In short all the user interface logic is contained within the VIEW
Controller– It is the controller that answers to user actions. Based on the user actions, the respective controller responds within the model and choose a view to render that display the user interface.  The user input logic is contained with-in the controller

3) Explain in which assembly is the MVC framework is defined?
The MVC framework is defined in System.Web.Mvc.

4) List out few different return types of a controller action method?
View Result
Javascript Result
Redirect Result
Json Result
Content Result

5) Mention what is the difference between adding routes, to a webform application and an MVC application?
To add routes to a webform application, we can use MapPageRoute() method of the RouteCollection class, where adding routes to an MVC application, you can use MapRoute() method.

6) Mention what are the two ways to add constraints to a route?
The two methods to add constraints to a route is
Use regular expressions
Use an object that implements IRouteConstraint Interface

7) Mention what is the advantages of MVC?
MVC segregates your project into a different segment, and it becomes easy for developers to work on
It is easy to edit or change some part of your project that makes project less development and maintenance cost
MVC makes your project more systematic

8) Mention what “beforFilter()”,“beforeRender” and “afterFilter” functions do in Controller?
beforeFilter(): This function is run before every action in the controller. It’s the right place to check for an active session or inspect user permissions.
beforeRender(): This function is called after controller action logic, but before the view is rendered. This function is not often used, but may be required If you are calling render() manually before the end of a given action
afterFilter(): This function is called after every controller action, and after rendering is done. It is the last controller method to run

9) Explain the role of components Presentation, Abstraction and Control in MVC?
Presentation: It is the visual representation of a specific abstraction within the application
Abstraction: It is the business domain functionality within the application
Control: It is a component that keeps consistency between the abstraction within the system and their presentation to the user in addition to communicating with other controls within the system

10) Mention the advantages and disadvantages of MVC model?
Advantages
Disadvantages
It represents clear separation between business logic and presentation logic

The model pattern is little complex

Each MVC object has different responsibilities

Inefficiency of data access in view

The development progresses in parallel

With modern user interface, it is difficult to use MVC

Easy to manage and maintain

You need multiple programmers for parallel development

All classes and object are independent of each other

Multiple technologies knowledge is required



Comments

Popular posts from this blog

Gemini software Dot net interview question for experienced

Gemini Interview questions 4-8 year experienced Dot net professional Gemini Interview questions 4-8 year experienced Dot net professional 1,Asp .net mvc request life cycle. 2,How routing works 3,Where codes for routing are written 4,What is attribute based routing in aap.net Mvc 5,Is multiple routes possible on a single action method. 6,What is action filters. 7,what is authentication and authorization filters 8,What are the types of authentication 8,What is the use of data annotation 9,Can we fire data annotation in client side. 10,What is model binding 11,what are Html helpers

15 Essential jQuery Interview Questions

15 Essential jQuery Interview Questions 15 Essential jQuery Interview Questions 1,Explain what the following code will do: $( "div#first, div.first, ol#items > [name$='first']" ) Ans:This code performs a query to retrieve any element with the id first, plus all elements with the class first, plus all elements which are children of the element and whose name attribute ends with the string "first". This is an example of using multiple selectors at once. The function will return a jQuery object containing the results of the query. 2,What is wrong with this code, and how can it be fixed to work properly even with buttons that are added later dynamically? // define the click handler for all buttons $( "button" ).bind( "click", function() {     alert( "Button Clicked!" ) }); /* ... some time later ... */ // dynamically add another button to the page $( "html" ).append( " Click...

ASP .Net MVC

ASp .Net MVC 1. Explain MVC (Model-View-Controller) in general? MVC (Model-View-Controller) is an architectural software pattern that basically decouples various components of a web application. By using MVC pattern, we can develop applications that are more flexible to changes without affecting the other components of our application. §    “Model”, is basically domain data. §    “View”, is user interface to render domain data. §    “Controller”, translates user actions into appropriate operations performed on model. 2. What is ASP.NET MVC? ASP.NET MVC is a web development framework from Microsoft that is based on MVC (Model-View-Controller) architectural design pattern. Microsoft has streamlined the development of MVC based applications using ASP.NET MVC framework. 3. Difference between ASP.NET MVC and ASP.NET WebForms? ASP.NET Web Forms uses Page controller pattern approach for rendering layout, whereas ASP.NET MVC uses Front con...