title: Call a controller method with parameters from partial view mvc 5
body: <p>I'm trying to call an action method Details, which takes id as a parameter, in my UsersController from partial view. The link in my partial view is like this</p>
  
  <pre><code>@Html.ActionLink("My Account", "Details", "Users", routeValues: null, htmlAttributes: new { id = User.Identity.GetUserId() })
  </code></pre>
  
  <p>And this is my ActionMethod</p>
  
  <pre><code>public ActionResult Details(long? id)
      {
          if (id == null)
          {
              return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
          }
          User user = db.Users.Find(id);
          if (user == null)
          {
              return HttpNotFound();
          }
          return View(user);
      }
  </code></pre>
  
  <p>i.e. a very basic action method generated by scaffolding.
  Now the problem is that when I click on the link the parameter 'id' is never appended to the url. The url looks something like this</p>
  
  <pre><code>localhost:8888/Users/Details
  </code></pre>
  
  <p>When it should have the appended the id value at the end.
  Does anyone know where I'm going wrong with this?</p>