Asp.Net MVC 5 Interview Questions Tutorial
MVC 5 Interview Questions and Answers for Experienced
Q. How we can use Viewstate in MVC5?
A. This is tricky question. Because MVC 5 does not support ViewState. The reason for not supporting it is that ViewState keeps data in hidden fields, and that makes the page load slow because of large page size.
Q. What are filters?
A. Filters helps us to execute some logic before or after the execution of an action method. These action filters are applied as attribute on the action method. There are 4 types of action filters supported by MVC 5:
- Authorization filter
- Action filter
- Result filter
- Exception filter
Q. From these filters, which executes in the last?
A. Exception filter always executes in the last.
Q. What is the difference between "ActionResult" and "ViewResult"?
A. "ActionResult" is an abstract class while "ViewResult" is derived from "ActionResult" class. "ActionResult" has a number of derived classes like "JsonResult", "FileStreamResult" and "ViewResult".