I have an URL like this /home/action/id
/home/action/id
How can I access this id in view?
you can pass it in through viewData;
In your Controller:
public ActionResult Index(string id) { ViewData["Name"] = Server.UrlEncode(id); return View(); }
In your View:
<%= ViewData["Name"] %>