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

Popular posts from this blog

Offers on Friday, April 24, 2020

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