views:

62

answers:

1

Does the ActionLinkForAreas link extension work with parameters + custom routes?

I have a route that exists matching my action which is:

routes.MapRoute("Profile", "profile/{artist}/{action}", new {controller="Profile", action="Index"});

But when I call ActionLinkForAreas like this:

<%= Html.ActionLinkForAreas<ProfileController>(x => x.Index("DJ"), "DJ") %>

It returns /profile/?artist=DJ where as I would like it to return /profile/DJ as my route is setup.

If i call ActionLink it returns the correct URL, i have tested this in the Northwind sample project and I get the same result.

Am I missing something?

A: 

Paul, You might be correct that this is a bug. There are no unit tests to test this either. Right now we are in the middle of a re-write for S#arp Architecture and the areas support we currently have in 1.5.2 will not be in 2.0. We have decided to use the built-in areas 100% completely. If we have to add a custom view engine, it will be due to the need to override the area locations.

Since we are working on 2.0 and this feature is going away, I have to be honest and say that we most likely will not jump on this one to fix it. I would however welcome a patch as I am sure others would be grateful as well.

Alec

Alec Whittington

related questions