I am following this book Pro.ASP.NET.MVC.3.Framework from Adam Freeman.
So I download the code and is generating this html code in his menu categories.
The html:
<a class="" href="/Chess%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20">Chess </a>
The result when I press the link (obvious):
http://localhost:43190/Chess%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20
I don’t know somebody has this issue with this book.
I try in my global.asax:
routes.IgnoreRoute("favicon.ico");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
In my layout:
<link rel="shortcut icon" href="@Url.Content( "~/Content/themes/base/images/favicon.ico" )" type="image/x-icon" />
And in my ninject controller:
protected override IController GetControllerInstance(System.Web.Routing.RequestContext requestContext, Type controllerType)
{
if (controllerType != null)
{
return (IController)ninjectKernel.Get(controllerType);
}
else
{
return base.GetControllerInstance(requestContext, controllerType);
}
}
I don’t know if someone have the same issue as me. How can I solve this?
Edited:
the real answer
ok I Understood know my sql was nvarchar so it generated blank space, i change to varchar and know not generate the blanck spaces
I read somewhere that adding .trim() it will do it and yes it work i dont understand why it put this (%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)
change this “category = link,” for this
“category = link.Trim(),”
the Menu.chtml