title: Passing textbox value to ActionResult TempData in MVC5
body: <p>I am very new to MVC , and trying to learn from videos given for MVC. In one of the video i have gone through the use of Tempdata. In the video they have shown created action result with HTTPPOST and pass data from textbox to controller and then to view using Tempdata . I have tried to practice the same . But i am not getting value from textbox,always returning as null. Below is my code,</p>
  
  <p>Controller as below,</p>
  
  <pre><code>        public ActionResult Create()
          {
              return View();
          }
  
          [HttpPost]
          public ActionResult Create(string name)
          {
              TempData["uname"] =name;
              return RedirectToAction("GetUser");
          }
  
          public ActionResult GetUser()
          {
              return View();
          }
  </code></pre>
  
  <p>View for Create as below,</p>
  
  <pre><code>@{
      ViewBag.Title = "Create";
  }
  
  &lt;h2&gt;Create New User&lt;/h2&gt;
  @using (Html.BeginForm())
  {
      &lt;div&gt;
          &lt;p&gt;Enter your name : &lt;input type="text" id="id" placeholder="Enter username"/&gt;&lt;/p&gt;
          &lt;p&gt;&lt;input type="submit" id="btnSubmit" value="Create"/&gt;&lt;/p&gt;
      &lt;/div&gt;
  }
  </code></pre>
  
  <p>View for GetUser,</p>
  
  <pre><code>@{
      ViewBag.Title = "GetUser";
  }
  
  &lt;h2&gt;GetUser&lt;/h2&gt;
  
  &lt;div&gt;
      &lt;h3&gt;Welcome @TempData["uname"].ToString()&lt;/h3&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When i enter value in textbox and press button id parameter in Create action is null. Also i have not created any model class, as in video they have just shown as above code. Please give me some suggestions.</p>
  
  <p>Regards
  Sangeetha</p>