I have an action like this:
public ActionResult UserDetails(string id)
{
}
context.MapRoute(
"Admin_Default",
"{controller}/{action}/{id}",
new { action = "Index", controller = "Start", id = UrlParameter.Optional }
);
In another view i have a list with users from the standard membership management in .net Idea is that you click on a username to show the details and this works, only if the username is in one word. I recently encountered a username that looks like this:
Steven C.H. Andersson
So i use this to produce the link:
@Html.ActionLink(Model.UserName, "UserDetails", new { controller = "Security", id = HttpUtility.UrlEncode(Model.UserName) })
But when i click on it, i get: HTTP Error 404.11 - Not Found
If i click on a normal username that is one word, it works like a charm.
I assume that the route config is not understanding this request, question is how to get it to work?
Update
Link:
<a href="/Security/UserDetails/Steven%2bC.H.%2bAndersson">Steven C.H. Andersson</a>