I have been looking everywhere for this answer. I can’t find any solution. I am using MVC3 ASP.NET. I am trying to make it so that when a user clicks on their profile it directs them to their profile using their id. So far nothing has worked.
<a href=@Html.ActionLink("",
"Profile",
"Followers",
new { id = (new UserService().GetUserByUserName(User.Identity.Name)).Id})>
<img src="blah.jpg" />
</a>
This does not seem to work. Any suggestions?
Html.ActionLinkreturns a complete<a>tag, not a URL.You want to call
Url.Action.