Alex Rivera | Logout

ASP.NET MVC: ActionLink vs bare url

Asked 2010-08-12T04:57:18.283
10

In ASP.NET MVC I see I have handy HTML helpers that I can use to construct form fields and any number of other little things. But then there's 'ActionLinks'.

Why use an ActionLink instead of just writing the darn url myself in an HTML anchor tag?

In other words, why would I use

<%: Html.ActionLink("Back to List", "QuantityTypes") %>

instead of just using plain ol' HTML and writing:

<a href="/internal/quantitytypes">Back to List</a>

Surely, I must get something extra with the ActionLink. I'm just missing it, right?

Edit
Report

1 Answer

0

You get centralized control of your URL's. So next time you need to change one for SEO purposes, you don't have to go searching for every place in the application, just switch it in the Global.asax.

answered 2010-08-12T05:00:58.683

Your Answer