How to inspect the values inside the route in ASP.Net MVC C#
public ActionResult Index()
{
var Controller = RouteData.Values["controller"];
var Action = RouteData.Values["action"];
var Id = RouteData.Values["id"];
string Output = string.Format("Controller = {0}, Action= {1}, Id= {2}",
Controller, Action, Id);
ViewBag.Message = Output;
return View();
}
}
Comments
Post a Comment