1) List out the types of result in MVC?
In MVC, there are twelve types of results in MVC where “ActionResult” class is the main class while the 11 are their sub-types
All public methods of a controller class are treated as the action method if you want to prevent this default method then you have to assign the public method with NonActionAttribute.
3) Mention what is the use of the default route {resource}.axd/{*pathinfo} ?
This default route prevents request for a web resource file such as Webresource.axd or ScriptResource.axd from being passed to the controller.
4) Mention the order of the filters that get executed, if the multiple filters are implemented?
The filter order would be like
In the end “Exception Filters” are executed.
6) Mention what are the file extensions for razor views?
For razor views the file extensions are
Two methods for adding constraints to route is
Two instance where routing is not required are
There are two key benefits of using MVC
Tags: ASP.NET MVC Interview Questions and Answers At Capgemini, Capgemini, Interview Questions and Answers At Capgemini, ASP.NET MVC, ASP.NET MVC Interview Questions, ASP.NET MVC QA, ASP.NET MVC Interview Questions and Answers, ASP.NET MVC Tutorial, ASP.NET MVC books, ASP.NET MVC Interview Questions pdf, ASP.NET MVC experienced QA, interview questions, ASP.NET MVC interview questions for experienced, ASP.NET MVC interview questions for developers,ASP.NET MVC interview questions for freshers,ASP.NET MVC interview questions senior level, ASP.NET MVC Certification Questions, Basic ASP.NET MVC interview questions, ASP.NET MVC interview questions 2 3 4 5 6 years experienced, ASP.NET MVC Real time interview questions, ASP.NET MVC Interview Questions and Answers At Capgemini 2015, Latest ASP.NET MVC Questions At Capgemini Interview.
In MVC, there are twelve types of results in MVC where “ActionResult” class is the main class while the 11 are their sub-types
- ViewResult
- PartialViewResult
- EmptyResult
- RedirectResult
- RedirectToRouteResult
- JsonResult
- JavaScriptResult
- ContentResult
- FileContentResult
- FileStreamResult
- FilePathResult
All public methods of a controller class are treated as the action method if you want to prevent this default method then you have to assign the public method with NonActionAttribute.
3) Mention what is the use of the default route {resource}.axd/{*pathinfo} ?
This default route prevents request for a web resource file such as Webresource.axd or ScriptResource.axd from being passed to the controller.
4) Mention the order of the filters that get executed, if the multiple filters are implemented?
The filter order would be like
- Authorization filters
- Action filters
- Response filters
- Exception filters
In the end “Exception Filters” are executed.
6) Mention what are the file extensions for razor views?
For razor views the file extensions are
- .cshtml: If C# is the programming language
- .vbhtml: If VB is the programming language
Two methods for adding constraints to route is
- Using regular expressions
- Using an object that implements IRouteConstraint interface
Two instance where routing is not required are
- When a physical file is found that matches the URL pattern
- When routing is disabled for a URL pattern
There are two key benefits of using MVC
- As the code is moved behind a separate class file, you can use the code to a great extent
- As behind code is simply moved to.NET class, it is possible to automate UI testing. This gives an opportunity to automate manual testing and write unit tests.
10) Explain how you can send the result back in JSON format in MVC?
In order to send the result back in JSON format in MVC, you can use “JSONRESULT” class.
In order to send the result back in JSON format in MVC, you can use “JSONRESULT” class.
1 comments:
Write commentsMVC is a framework pattern that splits an application’s implementation logic into three component roles: models, views, and controllers.mvc interview questions
Reply