Interviews28 answers
What are the different types of results in MVC?
28 Answers
https://www.exceptionnotfound.net/asp-net-mvc-demystified-actionresults/
HemlataPosted Jun 17, 2017, 10:18 PM EDT
https://www.exceptionnotfound.net/asp-net-mvc-demystified-actionresults/
HemlataPosted Jun 17, 2017, 10:18 PM EDT
Please see nice link here: http://www.c-sharpcorner.com/UploadFile/dacca2/various-return-types-from-mvc-controller/
Anil SatapathyPosted Feb 27, 2017, 8:28 AM EST
1- ViewResult.
2- PartialViewResult .
3 -RedirectResult.
4 -RedirectToRouteResult .
5 - ContentResult .
6 - JsonResult.
7- JsonResult.
8- JavaScriptResult.
9- FileResult.
10 - EmptyResult.
Mohammed Deeb HammoudehPosted Dec 14, 2016, 11:09 PM EST
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 ShindePosted Dec 12, 2016, 11:43 PM EST
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 ShindePosted Dec 12, 2016, 11:42 PM EST
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 ShindePosted Dec 12, 2016, 11:42 PM EST
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 ShindePosted Dec 12, 2016, 11:42 PM EST
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 ShindePosted Dec 12, 2016, 11:42 PM EST
ViewResult
PartialViewResult
RedirectResult
RedirectToRouteResult
ContentResult
JsonResult
JavaScriptResult
FileResult
EmptyResult
Ramesh SPosted Nov 29, 2016, 1:19 AM EST
https://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult(v=vs.118).aspx
Aleena SaviourPosted Nov 2, 2016, 5:27 AM EDT
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 NPosted Oct 22, 2016, 1:17 PM EDT
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 NPosted Oct 22, 2016, 1:12 PM EDT
ViewResult
partialViewResult
ContentResult
EmptyResult
FileResult
JavaScriptResult
JsonResult
RedirectResult
RedirectToRouteResult
Umesh MauryaPosted Sep 4, 2016, 3:44 AM EDT
the different type of results in mvc are
ViewResult, PartialViewResult, RedirectResult, RedirectToRouteResult, ContentResult, JsonResult, JavaScriptResult, FileResult, EmptyResult
Vinay SinghPosted Aug 10, 2016, 2:40 AM EDT
1) ViewResult 2) PartialViewResult 3) RedirectResult 4) RedirectToRouteResult 5) JsonResult 6) JavaScriptResult
Soumalya DasPosted Aug 7, 2016, 8:30 AM EDT
System.Object
System.Web.Mvc.ActionResult
System.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 SrivastavaPosted Aug 4, 2016, 5:47 AM EDT
Please see nice link here:
http://www.c-sharpcorner.com/UploadFile/dacca2/various-return-types-from-mvc-controller/
Ritesh SinghPosted Jul 26, 2016, 5:51 AM EDT
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 AgarwalPosted Jun 28, 2016, 9:01 PM EDT
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 AgarwalPosted Jun 28, 2016, 9:01 PM EDT
System.Web.Mvc.ActionResult
System.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 VenkatesanPosted Jun 7, 2016, 9:43 PM EDT
There are multiple results in MVC,Action Result is base for all result.
System.Object
System.Web.Mvc.ActionResult
System.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
Reference
http://www.c-sharpcorner.com/UploadFile/dacca2/various-return-types-from-mvc-controller/
Bhuvanesh MohankumarPosted May 20, 2016, 8:21 AM EDT
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
Santosh Kumar AdidawarpuPosted May 9, 2016, 9:26 AM EDT
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 KumarPosted Apr 17, 2016, 1:43 AM EDT
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:
ContentResult
EmptyResult
FileResult
HttpStatusCodeResult
JavaScriptResult
JsonResult
RedirectResult
RedirectToRouteResult
ViewResultBase
Out these results most widely used result types are:
ContentResult
JsonResult
FileResult
ActionResult
Refernce:
https://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult(v=vs.118).aspx
Rahul ChavanPosted Apr 6, 2016, 4:29 AM EDT
Refer this url for answer http://www.dotnetfunda.com/articles/show/2236/action-results-in-the-controllers-mvc4
Pankaj Kumar ChoudharyPosted Feb 9, 2016, 4:11 PM EST
http://dotnet-munesh.blogspot.in/2016/02/what-are-different-types-of-results-in.html
Munesh SharmaPosted Feb 8, 2016, 7:15 PM EST
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 DashPosted Feb 5, 2016, 3:05 AM EST


















