baseRoute-relative and application-relative controller reference syntax is confusing #1159

Imported from the CodePlex archive for reference purposes. Support for MvcCodeRouting has ended.

Reported on

Using the tilde character ~ for baseRoute-relative references is confusing, considering that it’s used for application-relative paths everywhere else, e.g.

  • Razor: <a href="~/">Home</a>
  • View engine: Html.Partial("~/Views/Shared/Foo.cshtml")
  • Other: VirtualPathUtility.ToAbsolute("~/foo")

Using the double tilde ~~ for application-relative references is also confusing, given the above. It also looks weird.

Proposal for v2

Change the single tilde to application-relative (keeping the double tilde for back compat) and introduce a new character for baseRoute-relative, e.g. Url.Action("", "^Account")

Note: Custom routes also use single tilde.