Interviews4 answers
Explain types of ReturnTypes of Action Mehtods in Asp.Net MVC?
4 Answers
Rajeev KumarPosted Mar 31, 2023, 3:32 AM EDT
As you can see, there are three categories of data types of ActionResult,
Content Returning Results
Redirection Results
Status Results
Rajeev KumarPosted Mar 31, 2023, 3:32 AM EDT
View result , partial view result , json result , javascript result , action result , filecontent result , redirecttoroute result , filepath result , empty result, redirecttoresult
Rajani PandeyPosted Jan 7, 2018, 7:19 AM EST
The following table shows the built-in action result types,
• ViewResult: it renders a view as a Web page.
• PartialViewResult: It renders a partial view.
• RedirectToResult: It redirects to the specified URL.
• RedirectToRouteResult: It redirects to different action/different controller action
• ContentResult: It returns file string.
• FileContentResult: It returns file content.
• FilePathResult: It returns file content.
• FileStreamResult: It returns file content.
• EmptyResult: It returns nothing.
• JavaScriptResult: It returns script for execution.
• JsonResult : It returns JSON formatted data.
• HttpUnauthorizedResult : it returns 403 HTTP Status code
Pradeep YadavPosted May 26, 2017, 1:05 AM EDT

