You mean like using the Action method on the Url helper:
<%= Url.Action("DoThis", "MyController") %>
or in Razor:
@Url.Action("DoThis", "MyController")
which will give you a relative url (/MyController/DoThis
).
And if you wanted to get an absolute url (http://localhost:8385/MyController/DoThis
):
<%= Url.Action("DoThis", "MyController", null, Request.Url.Scheme, null) %>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…