在页面上显示URL的优雅方式(An elegant way of showing URL on page)

是否有一种优雅的方式使用ASP.NET MVC3在页面上显示URL。我正在寻找的方法应该接受contollerName,actionName和routeValue(类似于@ Html.ActionLink()通过参数)

egCode:这是链接:@ thatMethod (“Show”,“Post”,new {Post = 0})

egResult:这是链接: http:// localhost:3120 / Post / Show / 0

编辑1:我不是它的超链接,只是纯文本。

编辑2:它需要显示域(前一个例子中的“http:// localhost:3120”)

Is there an elegant way of showing URL on page using ASP.NET MVC3 .The method I'm looking for should accept contollerName,actionName and routeValue(similiar to @Html.ActionLink() by arguments)

e.g.Code: Here's the link: @thatMethod("Show", "Post", new { Post = 0 })

e.g.Result: Here's the link: http://localhost:3120/Post/Show/0

EDIT 1: I dont wan't it to be hyperlink,just plain text.

EDIT 2: It needs to show domain ("http://localhost:3120" in previous example)

最满意答案

这是一个更好的解决方案。

This is an even better solution.

更多推荐