1

I am learning ASP.NET MVC and came across this particular Html Helper method.

When would one use

@Html.RouteLink("Routed Link", new { controller = "Home", action = "About", id="MyID"})

What is the difference between this and Html.ActionLink()?

ckv
  • 10,539
  • 20
  • 100
  • 144

2 Answers2

1

According to: What's the difference between RouteLink and ActionLink in ASP.NET MVC?

ActionLink will generate the URL to get to an action using the first matching route by action name.

RouteLink will generate a URL to a specific route determined either by name or route values.

Community
  • 1
  • 1
whoah
  • 4,363
  • 10
  • 51
  • 81
1

ActionLink is a specific way to link to a specific action by specifying the action and controller. RouteLink gives you more control over the routing. For instance, look at this override which gives you the most flexibility in generating a URL, not necessarily tied to an action.

Brian Mains
  • 50,520
  • 35
  • 148
  • 257