Here in this article, we will learn about the different type of action results available in ASP.NET MVC 5. There are various action methods in MVC 5 but ActionResult is the base class for all the action methods available in MVC 5.
As we can see it is the base class which is defined as abstract class.
It returns the view page which has .cshtml extension in controller folder.
public ViewResult ViewDemo() { return View(); }
It returns the partial view as a result. Partial view is placed inside a Normal view page.
public PartialViewResult Sidebar() { return PartialView("_Sidebar"); }
It returns the result to a specific URL. It renders to the page by URL
public RedirectResult About() { return Redirect("Contact"); }
It returns the result to the specific controller and action method.
public ActionResult Index() { return RedirectToAction("About", "Manage"); }
It is useful when we call the method using the ajax.
public JsonResult Index() { return Json("Successful", JsonRequestBehavior.AllowGet); }
It returns different file format view page using file result
public ActionResult FileDemo() { return File("Web.Config", "text"); }
It returns different content’s format to view.
public ActionResult Index() { return Content("<script>alert('Content Result');</script>"); }
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular