I have the following code in my site.master
for a menu:
<ul id="menu">
<li><%= Html.ActionLink("My Contact Info", "DetailsbyUserName/" + Html.Encode(Page.User.Identity.Name), "Users")%></li>
</ul>
When I hover over the URL I see that it points to:
http://site/Users/DetailbyUserName/[name]
which is correct.
The issue is that when I put a breakpoint in the Users
controller class below:
public ActionResult DetailsbyUserName(string loginName)
{
UserInfo user = repo.GetUserByName(loginName);
return View(user);
}
it seems that the loginName
parameter is always null
.
Any suggestions?