Thanks to questpond.com to provide these MVC interview questions and support this site.
As we know in MVC when we try to access any resource first request goes to action method in controller. After that action method will do some processing and return back the
publicclassHomeController : Controller
Action result will be one of the follows.
- ContentResult – Represents a text result.
- EmptyResult – Represents no result.
- FileContentResult – Represents a downloadable file (with the binary content).
- FilePathResult – Represents a downloadable file (with a path).
- FileStreamResult – Represents a downloadable file (with a file stream).
- PartialViewResult – Represents HTML and markup rendered by a partial view.
- RedirectResult – Represents a redirection to a new URL.
- RedirectToRouteResult – Represents a result that performs a redirection by using the specified route values dictionary.
- ViewResult – Represents HTML and markup rendered by a view
Now, in order to create the instance of one of the above classes it’s not required to explicitly create the object of ActionResult or any of the above classes. Your controller base class has some helper methods which you can call and simply return. Some of these methods are
Do forget to read 50 MVC ( model view controller) interview questions with answers from codeproject.com