title: How do I get the value of an input of html.textbox in ASP.NET MVC 2
body: <p>I currently have a <code>TextBox</code> using:</p>
  
  <p><code>&lt;%: Html.TextBox("TextBox1") %&gt;</code></p>
  
  <p>How do I get the value of what is typed into the <code>TextBox</code> as a string so that I can use that string variable throughout my application?</p>
  
  <p>The view has he following with the inherits on top of page to model. This page is named "InputNumbersSection":</p>
  
  <pre><code>&lt;%: Html.TextBoxFor(m =&gt; m.Number) %&gt;
  </code></pre>
  
  <p>and the action:</p>
  
  <pre><code>&lt;%: Html.ActionLink("Get Number!", "DisplayNumbersSection") %&gt;
  </code></pre>
  
  <p>The Model has this:</p>
  
  <pre><code> public class NumberModels
      {
          public string Number { get; set; }
      }
  </code></pre>
  
  <p>The controller has the following:</p>
  
  <pre><code>public ActionResult DisplayNumbersSection(NumberModels model)
          {
  
              if (ModelState.IsValid)
              {
                  string TextBoxValue = model.Number;
                  ViewData["Number"] = TextBoxValue;
              }      
              return View();
          }
  </code></pre>
  
  <p>The ViewData I use in another page to return the number from the textbox typed in the view.</p>
  
  <p>When I type somthing into the textbox, I do not see the property getting hit or executed. The "Number" property returns NULL all the time. It almost seems as if it is not picking up what I type into the TextBox</p>