The code below is a terrible hack.
Uri linkUri = HttpContext.Current.Request.Url; string link = linkUri.ToString().Substring(0, linkUri.ToString().IndexOf("Users/Create"));
Instead of editing the line, how do I get the correct Url route in the first place?
For example, I want to get http://localhost:9999/ instead of http://localhost:9999/Users/Create
asp.net-mvc
arame3333
source share