28
Reply

What are the different types of results in MVC?

Chinmaya Dash

Chinmaya Dash

Feb 05, 2016
5.3k
2

    1. ViewResult - Renders a specified view to the response stream 2. PartialViewResult - Renders a specified partial view to the response stream 3. EmptyResult - An empty response is returned 4. RedirectResult - Performs an HTTP redirection to a specified URL 5. RedirectToRouteResult - Performs an HTTP redirection to a URL that is determined by the routing engine, based on given route data 6. JsonResult - Serializes a given ViewData object to JSON format 7. JavaScriptResult - Returns a piece of JavaScript code that can be executed on the client 8. ContentResult - Writes content to the response stream without requiring a view 9. FileContentResult - Returns a file to the client 10. FileStreamResult - Returns a file to the client, which is provided by a Stream 11. FilePathResult - Returns a file to the client

    Chinmaya Dash
    February 05, 2016
    7

    ViewResult PartialViewResult RedirectResult RedirectToRouteResult ContentResult JsonResult JavaScriptResult FileResult EmptyResult

    Ramesh S
    November 29, 2016
    2

    There are multiple results in MVC,Action Result is base for all result.System.Object System.Web.Mvc.ActionResultSystem.Web.Mvc.ContentResult System.Web.Mvc.EmptyResult System.Web.Mvc.FileResult System.Web.Mvc.HttpStatusCodeResult System.Web.Mvc.JavaScriptResult System.Web.Mvc.JsonResult System.Web.Mvc.RedirectResult System.Web.Mvc.RedirectToRouteResult System.Web.Mvc.ViewResultBaseReference http://www.c-sharpcorner.com/UploadFile/dacca2/various-return-types-from-mvc-controller/

    1) ViewResult 2) PartialViewResult 3) RedirectResult 4) RedirectToRouteResult 5) ContentResult 6) JsonResult 7) JavaScriptResult 8) HttpStatusCodeResult 9) HttpUnauthorizedResult 10) HttpNotFoundResult 11) FileResult 12) FileContentResult 13) FilePathResult 14) FileStreamResult 15) EmptyResult

    Vivek Kumar
    April 17, 2016
    2

    Please see nice link here: http://www.c-sharpcorner.com/UploadFile/dacca2/various-return-types-from-mvc-controller/

    Anil Satapathy
    February 27, 2017
    1

    1- ViewResult.2- PartialViewResult . 3 -RedirectResult.4 -RedirectToRouteResult .5 - ContentResult .6 - JsonResult.7- JsonResult.8- JavaScriptResult.9- FileResult.10 - EmptyResult.

    Mohammed Deeb Hammoudeh
    December 15, 2016
    1

    ViewResult =>ViewResult Renders a view as a web page. PartialViewResult =>As the name describe PartialViewResult=> renders the partial view. RedirectResult =>When you want to redirect to another action method we will use RedirectResult RedirectToRouteResult =>Redirect to another action method ContentResult =>Returns a user-defined content type JsonResult =>When you want to return a serialized JSON object JavaScriptResult=>Returns a script that can be executed on the client FileResult=>Returns a binary output to write to the response EmptyResult

    Mohini Shinde
    December 13, 2016
    1

    ViewResult =>ViewResult Renders a view as a web page. PartialViewResult =>As the name describe PartialViewResult=> renders the partial view. RedirectResult =>When you want to redirect to another action method we will use RedirectResult RedirectToRouteResult =>Redirect to another action method ContentResult =>Returns a user-defined content type JsonResult =>When you want to return a serialized JSON object JavaScriptResult=>Returns a script that can be executed on the client FileResult=>Returns a binary output to write to the response EmptyResult

    Mohini Shinde
    December 13, 2016
    1

    ViewResult =>ViewResult Renders a view as a web page. PartialViewResult =>As the name describe PartialViewResult=> renders the partial view. RedirectResult =>When you want to redirect to another action method we will use RedirectResult RedirectToRouteResult =>Redirect to another action method ContentResult =>Returns a user-defined content type JsonResult =>When you want to return a serialized JSON object JavaScriptResult=>Returns a script that can be executed on the client FileResult=>Returns a binary output to write to the response EmptyResult

    Mohini Shinde
    December 13, 2016
    1

    ViewResult =>Renders a view as a web page. PartialViewResult =>As the name describe PartialViewResult=> renders the partial view. RedirectResult =>When you want to redirect to another action method we will use RedirectResult RedirectToRouteResult =>Redirect to another action method ContentResult =>Returns a user-defined content type JsonResult =>When you want to return a serialized JSON object JavaScriptResult=>Returns a script that can be executed on the client FileResult=>Returns a binary output to write to the response EmptyResult

    Mohini Shinde
    December 13, 2016
    1

    ViewResult =>ViewResult Renders a view as a web page. PartialViewResult =>As the name describe PartialViewResult=> renders the partial view. RedirectResult =>When you want to redirect to another action method we will use RedirectResult RedirectToRouteResult =>Redirect to another action method ContentResult =>Returns a user-defined content type JsonResult =>When you want to return a serialized JSON object JavaScriptResult=>Returns a script that can be executed on the client FileResult=>Returns a binary output to write to the response EmptyResult

    Mohini Shinde
    December 13, 2016
    1

    https://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult(v=vs.118).aspx

    Aleena Saviour
    November 02, 2016
    1

    ActionResult Helper Method Description ViewResult View ViewResult Renders a view as a web page. PartialViewResult PartialView As the name describe PartialViewResult renders the partial view. RedirectResult Redirect When you want to redirect to another action method we will use RedirectResult RedirectToRouteResult RedirectToRoute Redirect to another action method ContentResult Content Returns a user-defined content type JsonResult Json When you want to return a serialized JSON object JavaScriptResult JavaScript Returns a script that can be executed on the client FileResult File Returns a binary output to write to the response EmptyResult (None) returns a null result

    Thennarasu N
    October 22, 2016
    1

    explained with an example and attached sample code, how to upload files to database in asp.net using FileUpload control and then download saved or stored files from SQL Server database using GridView control

    Thennarasu N
    October 22, 2016
    1

    ViewResult partialViewResult ContentResult EmptyResult FileResult JavaScriptResult JsonResult RedirectResult RedirectToRouteResult

    Umesh Maurya
    September 04, 2016
    1

    the different type of results in mvc are ViewResult, PartialViewResult, RedirectResult, RedirectToRouteResult, ContentResult, JsonResult, JavaScriptResult, FileResult, EmptyResult

    Vinay Singh
    August 10, 2016
    1

    1) ViewResult 2) PartialViewResult 3) RedirectResult 4) RedirectToRouteResult 5) JsonResult 6) JavaScriptResult

    Soumalya Das
    August 07, 2016
    1

    System.Object System.Web.Mvc.ActionResultSystem.Web.Mvc.ContentResult System.Web.Mvc.EmptyResult System.Web.Mvc.FileResult System.Web.Mvc.HttpStatusCodeResult System.Web.Mvc.JavaScriptResult System.Web.Mvc.JsonResult System.Web.Mvc.RedirectResult System.Web.Mvc.RedirectToRouteResult System.Web.Mvc.ViewResultBase

    Bikesh Srivastava
    August 04, 2016
    1

    Please see nice link here:http://www.c-sharpcorner.com/UploadFile/dacca2/various-return-types-from-mvc-controller/

    Ritesh Singh
    July 26, 2016
    1

    The ActionResult is the base class for all the return types . it may be either return viewresult , return javascriptresult or else . there are 13 types of results , including return file , return file result , return partial view , return content , return content result etc.

    Prakhar Agarwal
    June 29, 2016
    1

    The ActionResult is the base class for all the return types . it may be either return viewresult , return javascriptresult or else . there are 13 types of results , including return file , return file result , return partial view , return content , return content result etc.

    Prakhar Agarwal
    June 29, 2016
    1

    System.Web.Mvc.ActionResultSystem.Web.Mvc.ContentResult System.Web.Mvc.EmptyResult System.Web.Mvc.FileResult System.Web.Mvc.HttpStatusCodeResult System.Web.Mvc.JavaScriptResult System.Web.Mvc.JsonResult System.Web.Mvc.RedirectResult System.Web.Mvc.RedirectToRouteResult System.Web.Mvc.ViewResultBase

    Keerthi Venkatesan
    June 08, 2016
    1

    1. ContentResult 2. EmptyResult 3. FileResult 4. StatusCodeResult 5. JavaScriptResult 6. JsonResult 7. RedirectResult 8. RedirectToRouteResult 9. ViewResultBase 10. ViewResult 11. PartialViewResult 12. HttpStatusCodeResult 13. HttpUnauthorizedResult 14. HttpNotFoundResult 15. FilePathResult 16. FileStreamResult

    Action method returns the Results ActionResult. User response is encapsulated in ActionResult. ActionResult class is the base class for all action results. Types of Results:ContentResultEmptyResultFileResultHttpStatusCodeResultJavaScriptResultJsonResultRedirectResultRedirectToRouteResultViewResultBaseOut these results most widely used result types are: ContentResult JsonResult FileResult ActionResultRefernce: https://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult(v=vs.118).aspx

    Rahul Chavan
    April 06, 2016
    1

    Refer this url for answer http://www.dotnetfunda.com/articles/show/2236/action-results-in-the-controllers-mvc4

    Pankaj Kumar Choudhary
    February 09, 2016
    1

    http://dotnet-munesh.blogspot.in/2016/02/what-are-different-types-of-results-in.html

    Munesh Sharma
    February 09, 2016
    1

    https://www.exceptionnotfound.net/asp-net-mvc-demystified-actionresults/

    Hemlata
    June 18, 2017
    0

    https://www.exceptionnotfound.net/asp-net-mvc-demystified-actionresults/

    Hemlata
    June 18, 2017
    0