twitter.bootstrap.mvc icon indicating copy to clipboard operation
twitter.bootstrap.mvc copied to clipboard

Bad url for "Home" controller actions

Open sergiomcalzada opened this issue 12 years ago • 2 comments

"NavigationRouteConfigurationExtensions" generate incorrect url when a action in HomeController (different from index) is added.

File NavigationRouteConfigurationExtensions, method CreateUrl.

Patch:

public static string CreateUrl(string actionName, string controllerName) { if (controllerName.Equals("home", StringComparison.CurrentCultureIgnoreCase)) { if (actionName.Equals("index", StringComparison.CurrentCultureIgnoreCase)) { return ""; } //else //{ // return actionName.ToLower(); <-- Incorrect url for home controller action //} }

        return controllerName.ToLower() + "/" + actionName.ToLower();
    }

sergiomcalzada avatar Jan 31 '13 15:01 sergiomcalzada

I dont know why I changed this. :) I will update the unit test and push a change out

Eric Hexter

blog | http://Hex.LosTechies.com info | http://www.linkedin.com/in/erichexter

On Thu, Jan 31, 2013 at 9:34 AM, Sergio [email protected] wrote:

"NavigationRouteConfigurationExtensions" generate incorrect url when a action in HomeController (different from index) is added.

File NavigationRouteConfigurationExtensions, method CreateUrl.

Patch:

public static string CreateUrl(string actionName, string controllerName) { if (controllerName.Equals("home", StringComparison.CurrentCultureIgnoreCase)) { if (actionName.Equals("index", StringComparison.CurrentCultureIgnoreCase)) { return ""; } //else //{ // return actionName.ToLower(); <-- Incorrect url for home controller action //} }

    return controllerName.ToLower() + "/" + actionName.ToLower();
}

— Reply to this email directly or view it on GitHubhttps://github.com/erichexter/twitter.bootstrap.mvc/issues/64.

erichexter avatar Feb 01 '13 01:02 erichexter

Hi

Has this issue been fixed? I know when I use action link and include the the controller name it shows the url with ?length5

tejpowar avatar Feb 04 '13 08:02 tejpowar