2
Reply

Explain types of ReturnTypes of Action Mehtods in Asp.Net MVC?

Pradeep Yadav

Pradeep Yadav

7y
223
0
Reply

    View result , partial view result , json result , javascript result , action result , filecontent result , redirecttoroute result , filepath result , empty result, redirecttoresult

    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