15.6.1 Using Custom Variables as Action Method Parameters; Listing 15-18. Adding an Action Method Parameter in the HomeController.cs File
parent
0f14a97ae2
commit
b1390aba96
|
@ -16,11 +16,11 @@ namespace UrlsAndRoutes.Controllers
|
||||||
return View("ActionName");
|
return View("ActionName");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult CustomVariable()
|
public ActionResult CustomVariable(string id)
|
||||||
{
|
{
|
||||||
ViewBag.Controller = "Home";
|
ViewBag.Controller = "Home";
|
||||||
ViewBag.Action = "CustomVariable";
|
ViewBag.Action = "CustomVariable";
|
||||||
ViewBag.CustomVariable = RouteData.Values["id"];
|
ViewBag.CustomVariable = id;
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue