tags:

views:

435

answers:

4

OK, Microsoft removed strongly typed HTML.ActionLink from the main ASP.NET MVC assembly in beta because "of some features that can still evolve in future release of ASP.NET MVC"

But now MVC is officially released, why the strongly typed HTML.ActionLink is still not back?

+1  A: 

I believe it got moved in to the futures package.

I think the strongly typed methods are misleading anyway, remember, under the covers it is just a bunch of string maniplulations, after all URLs are just strings!

thatismatt
No... it's not, it's more useful than just mere syntactic purpose.If you need refactoring, you can just the refactoring tool to rename all the instances if you have strongly typed method. But if you are using string-based manipulation then I can only wish you good luck in hunting down every hardcoded string references.
Ngu Soon Hui
I should have been more explicit, I meant under the hood of MVC (not my code!) the strongly typed method converts that information into strings to generate the URL. See the source code on CodePlex, specifically [ExpressionHelper.GetRouteValuesFromExpression](http://aspnet.codeplex.com/SourceControl/changeset/view/23011#266392).
thatismatt
.. and if you read the post in Matt Hinze's answer you will see that the typed nature of the strongly typed ActionLink() skips over more internal MVC you you would prefer. MVC needs to do the 'mapping' of the action name to the method - the strongly typed ActionLink() stops MVC from doing that.
cottsak
+1  A: 

Two reasons:

  1. They don't presently support ActionNameAttribute, so they're arguably broken.
  2. There is no caching, so they're presently about 10 times slower than the framework methods.

Also, I agree with matt that we shouldn't pretend that URIs aren't strings.

Craig Stuntz
A: 

The link that Matt gave has moved to "http://haacked.com/archive/2008/08/29/how-a-method-becomes-an-action.aspx". And I agree that "the typed nature of the strongly typed ActionLink() skips over more internal MVC you you would prefer"; but I feel the solution to this isn't to give up on it and use magic strings, but instead to improve ActionLink() to generate a link which takes mappings into account!

Brian Kendig