본문 바로가기

ASP.net

html.actionlink와 url.action 차이

For example:

@Html.ActionLink("link text", "someaction", "somecontroller", new { id = "123" }, null)

generates:

<a href="/somecontroller/someaction/123">link text</a>

and

Url.Action("someaction", "somecontroller", new { id = "123" })

generates:

/somecontroller/someaction/123


출처: https://hassantariqblog.wordpress.com/2016/08/08/difference-between-html-actionlink-vs-url-action/