|
Answer» The base type for all the RETURN TYPES of action method is “Action Result”. Below are the various return types that can be used to return results from a controller action method. - ViewResult (View): This return type is used to return a webpage from the action method.
- PartialviewResult (Partial view the ): This is used to send part of a view that is GOING to render inside another view.
- RedirectResult (Redirect): This is used to redirect to any other controller and action method based on the URL.
- RedirectToRouteResult (RedirectToAction, RedirectToRoute): This is used to redirect to any other action method.
- ContentResult (Content): This is used to return HTTP content type text/plain as the result.
- JSONResult (JSON): This is used to return JSON as a result.
- JavascriptResult (javascript): This is used to return the JavaScript CODE that will run in the browser.
- FileResult (File): This is used to return binary output as a response.
- EmptyResult: This is used when nothing (VOID) to return.
|