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();


Popular posts from this blog

Fatal: LoadModule: error loading module 'mod_sql_mysql.c'

Regular Expression Route Constraints And Route Names in Laravel 5.4