- How to get the MyController Show url programatically?
- /MyController/Show/123
- public ActionResult Show(int id )
- {
- var completeURL = Request.RawUrl;
- var relativePath = Request.Path;
- var uriObject = Request.Url;
- }
- var url = Url.Action("Show", "MyController", new {id = 123});
- public ActionResult Index()
- {
- return RedirectToAction("Show", "MyController", new {id = 123});
- }