views:

439

answers:

1

I upgraded a large ASP.NET MVC application I've been working on to the latest beta today, and after some initial problems, I've got it mostly working again. The big problem is that I have things like this:

<%= Html.ActionLink("LOGIN", "Index", "Authorization", new { redirect=Request.Url })%>

and

<%= Html.ActionLink("Edit this page", "Edit", "Webpages", new { id = wp.Id })%>

That render the links as:

http://localhost:60321/calendar/edit?Length=8

Albeit with different "Lengths." I have no idea why this is happening; it's as though my route tables have gone completely insane. "calendar/edit/{id}" is a valid route, but it's about the fourth down on the list. These were working perfectly before.

I'm sort of at my wits end here trying to figure out what is going on... The link text renders perfectly; it's just the url of some of the ActionLink calls I have are not working. Some of them work fine. Here is an example of one that works fine:

<%= Html.ActionLink("ADMIN", "Index", "ControlPanel") %>

Any help would be greatly appreciated!

+2  A: 

From looking at the method signatures on ActionLink it looks like they have changed and it is matching the following:

ActionLink( string linkText, string action,
            object values, object htmlAttributes );

I would try adding a null htmlAttributes to the end of the ones that are not working so that it uses this one:

ActionLink( string linkText, string action, string controller,
            object values, object htmlAttributes );

This would look like:

<%= Html.ActionLink("LOGIN",
                    "Index",
                    "Authorization",
                    new { redirect=Request.Url },
                    null )%>

Source code for MVC Beta 1 is located at http://www.codeplex.com/aspnet (SCC server appears to be down at this moment 12/18/2008 1:16Pm CST). I found the signatures via intellisense.

tvanfosson
That was it! I should have checked that, as now the behavior makes perfect sense. Damn, that's going to be inconvenient... Thanks alot!
josh