Asp.Net MVC Action Results

Here we will learn action results in mvc with examples and different action results available in mvc with examples.

Asp.Net MVC Action Results

An ActionResult in mvc is an Abstract class, and ActionResult is the return type of controller method. Each ActionResult returns a different type of result. If we want to display an image in Webforms, we need to create Imagehandler for it, but in MVC we can use FileResult that is already a built-in method.


Whenever we create an empty controller in MVC we have the default ActionResult method created with the name Index, and it returns View(). It will have various other options also. Let's have a look at it.

Types of Action Results in Asp.Net MVC

Following are the list of action results available in mvc


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



It returns the user-defined content type.


return Content("I its my content result");



It returns a result that does nothing.


return new EmptyResult();



It returns binary file content to the response.




It returns a script that will be executed at the client browser.


public JavaScriptResult Examplejavascript()


var value = "alert('its JavaScriptResult')";

return JavaScript(value);




It returns a serialized JSON object.


public JsonResult Examplejson()


List<string> mystring = newList<string>();



return Json(mystring, JsonRequestBehavior.AllowGet);




It returns a partial view to the response.


public PartialViewResult ExamplePartialView()


return PartialView("Login");




It will redirect to a specific URI.


return Redirect("/Home/index");



It redirects to another action method.




It renders a view as a Web page.


return View("Index");

Each action result will perform different actions based on the type of action result in mvc.