asp.net-mvc ActionResult

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • // ActionResult method returns an instance that derives from ActionResult. You are able to create action method that can return any instance that is wrapped in appropriate ActionResult type.

  • //Built-in ActionResult return types are:

  • View(); // ViewResult renders a view as a WebPage

  • PartialView(); // PartialViewResult renders a partial view, which can be used as a part of another view.

  • Redirect(); // RedirectResult redirects to another action method by using its URL.

  • RediectToAction(); RedirectToRoute(); // RedirectToRouteResult redirects to another action method.

  • Content(); // ContentResult returns a user-defined content-type.

  • Json(); // JsonResult returns a serialized JSON object.

  • JavaScript(); // JavaScriptResult returns a script that can be executed on client side.

  • File(); // FileResult returns a binary output to write to the reponse.

  • // EmptResult represents a return value that is used if action method must return a null result.



Got any asp.net-mvc Question?