Tutorial by Examples

public ActionResult Index() { // Renders a view as a Web page. return View(); } Action methods typically return a result that is known as an action result. The ActionResult class is the base class for all action results. The ActionInvoker decide which type of action result to return ...
public ActionResult PopulateFoods() { IEnumerable<Food> foodList = GetAll(); // Renders a partial view, which defines a section of a view that can be rendered inside another view. return PartialView("_foodTable", foodVms);; } Action methods typically retur...
public ActionResult Index() { //Redirects to another action method by using its URL. return new RedirectResult("http://www.google.com"); } Action methods typically return a result that is known as an action result. The ActionResult class is the base class for all action resu...
public ActionResult PopulateFoods() { // Redirects to another action method. In this case the index method return RedirectToAction("Index"); } Action methods typically return a result that is known as an action result. The ActionResult class is the base class for all action ...
public ActionResult Hello() { // Returns a user-defined content type, in this case a string. return Content("hello world!"); } Action methods typically return a result that is known as an action result. The ActionResult class is the base class for all action results. The Ac...
public ActionResult LoadPage() { Student result = getFirst(); //Returns a serialized JSON object. return Json(result, JsonRequestBehavior.AllowGet); } Action methods typically return a result that is known as an action result. The ActionResult class is the base class for al...

Page 1 of 1