Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad url for "Home" controller actions #64

Open
sergiomcalzada opened this issue Jan 31, 2013 · 2 comments
Open

Bad url for "Home" controller actions #64

sergiomcalzada opened this issue Jan 31, 2013 · 2 comments
Milestone

Comments

@sergiomcalzada
Copy link

"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();
    }
@erichexter
Copy link
Owner

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 notifications@github.com 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//issues/64.

@tejpowar
Copy link

tejpowar commented Feb 4, 2013

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

@erichexter erichexter added this to the V1 milestone Dec 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants