Providing you use the default routes for this, you can change your controller method to use [Bind(Prefix="id")].
public ActionResult Details([Bind(Prefix="id")]string u)
{
if (u == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
AspNetUser user = db.AspNetUsers.Find(u);
if (user == null)
{
return HttpNotFound();
}
return View(user);
}
I think the method you use to find the user takes the userId though, and you send in the username. So that might be an issue as well!
Edit: example for finding the user by username
db.AspNetUsers.FirstOrDefault(usr=>usr.UserName == u)
The [Bind] prefix is only for making the url follow the normal syntax.