Advanced ASP .NET MVC Interview Questions and Answers

I am going to share basic ASP .NET MVC Interview Questions with Answers. It's really helpful for ASP .NET MVC fresher and ASP .NET MVC experienced candidate for getting the right ASP .NET MVC job.

Advanced ASP .NET MVC Interview Questions and Answers


Explain in breif about filters.

Filters are performs before and after action behaviors on controller’s action methods.

How MVC differ from Web Forms?

The following ways Web Forms differs from MVC,
Web Forms are tightly connected with logic but MVC separates logic part.
Web Forms are file based routing but MVC is URL based routing.
Web Forms uses master page concept but MVC supports layout approach.
Web Forms supports its own syntax but MVC supports Razor syntax.

How to maintain Session in MVC?

We can maintain Session in the following ways,

TempData
ViewData
ViewBag

JsonResultType in MVC?

It is used in AJAX appllication. The JSON result object that serializes the spiced object to JSON format. It is defined below,

public JsonResult JsonResultTest()

{

return Json(“Hello World!”);

}

Route Constraints in MVC?

It is used to add a specific contraint to the URL and defined in RouteConfig.cs file.

What are the ways for adding constraints to a route?

There are two methods for adding constraints to the route is Using regular expressions and object that implements IRoute Constraint interface.

What is ActionLink?

It is used to render an anchor tag to redirect another page.

What is Ajax libraries?

It is used to create web applications and provide dynamic link between the client and server.

What is bundling?

It is used to combine multiple files into single file.

What is HttpClient?

It is used to send and receive data from IIS server.

What is mean by Cross Site Scripting?

It is a kind of malicious attack from user tries to access entries via input fields.

What is output caching in MVC?

It is used to reduce hosting and the database connection defined in the server roud trips.

What is the NonAction method in MVC?

NonAction method is an attribute. By default all the methods in MVC framework as public. If you want to change the method as private, you can assign as NonAction method.

What is the separation of Concerns in ASP.NET MVC?

It is start of breaking the program into various distinct features which overlaps in functionality as little as possible. MVC pattern involvement on separating the content from presentation and data-processing from the content.

What is the use of DataAnnotation?

It is an attribute. It is used to apply validation to both client and server side.

What is the use of Localization?

It is the process of customize your applications for the current features.

What is the use of PartialView?

It is not defined in Layout page and designed specifically to render view.

What is the use of System.Web.Mvc.Async namespace?

It provides information about an asynchronous action method for name,Controller and its parameters.

What is the use ViewStart?

It is used to apply views to all pages automatically.

What is the ViewStart Page in MVC?

ViewStart page is used to make sure the common layout page will be used for multiple views. The code written in this file will be accomplished first when the application is being loaded.

Comments