title: Passing additional value to Controller method - Razor/MVC 5
body: <p>Hello I am having some trouble figuring out how to pass an additional value to my Controller's Delete method.</p>
  
  <p>I have a form with a Delete button (auto-generated MVC).</p>
  
  <pre><code>@using (Html.BeginForm())
  {
      @Html.AntiForgeryToken()
      &lt;div class="form-actions no-color"&gt;
          &lt;input type="submit" value="Delete" class="btn btn-sm btn-danger" /&gt;
          &lt;button onclick="location.href='@Url.Action("Index", "Admin")';return false;" class="btn btn-sm btn-primary" style="font-size:10px"&gt;Admin&lt;/button&gt;
      &lt;/div&gt;
  }
  </code></pre>
  
  <p>But I want to send along an additional value, this value would be the result of <code>getCookie("username");</code></p>
  
  <p>I have tried making another input and calling it.</p>
  
  <pre><code>&lt;input type="text" name="userid" value="getCookie('username')"  /&gt;
  </code></pre>
  
  <p>The problem is that this always shows "null" within my Controller method.</p>
  
  <p>The method is </p>
  
  <pre><code>    // GET: /Admin/Delete/5
      public ActionResult Delete(int? id, string userid)
      {
          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>and</p>
  
  <pre><code>// POST: /Admin/Delete/5
  [HttpPost, ActionName("Delete")]
  [ValidateAntiForgeryToken]
  public ActionResult DeleteConfirmed(int id, string userid)
  {
      User user = db.Users.Find(id);
      db.Users.Remove(user);
      db.SaveChanges();
      var time = new DateTime();
      string text = time + ": User " + user.name + " was deleted.";
      System.IO.File.AppendAllText(pathway, text + Environment.NewLine);
      return RedirectToAction("Index");
  }
  </code></pre>
  
  <p>All I want is to have the value of <code>getCookie('username');</code> passed on to a method as <code>userID</code>.</p>
  
  <p>Any help appreciated!</p>