title: MVC3 Razor > Input field
body: <p>In one of my views I got an INPUT field where I put my cursor and scan a MagCard through a reader. Which result in a series of chars in that box, ending with ENTER (char 13) which I catch via jQuery and post my form to another page to be processed.</p>
  
  <p>Basicly I want the string from the input box to be available in a controller, so I can deal with it using c# functions instead of doing it all client side via javascript.</p>
  
  <p>Getting values to managed code from client code seems to have eluded all guides I have found so far.</p>
  
  <p>Any help appreciated, and the reason for me to POST and not GET is because its filled with special chars, ?'s and spaces which need to be preserved.</p>
  
  <p>Any method will be valued.</p>
  
  <p>@Darin Dimitrov
  Sorry for me being unclear.</p>
  
  <p>While your suggestion works, and guided me a little towards what I need. (This will be handy to know no matter what.)</p>
  
  <p>As I don't really want a return value, I was trying to post to Home/ProcessScan as action for my form. Then in my controller make this:</p>
  
  <pre><code>    [AcceptVerbs(HttpVerbs.Post)]
      public ActionResult ProcessScan(string scanSeek)
      {
          string myScan = scanSeek;
          string name = myScan.Substring(1, 13);
          return Redirect("../reservation?name=" + name);
      }
  </code></pre>
  
  <p>And this now works for me. Had to:<br>
  * Use the [AcceptVerbs(HttpVerbs.Post)] declaration<br>
  * Change my type to ActionResult, instead of void, since redirect need return in front of it</p>
  
  <p>Note: for my redirect I use "../" because this view is not under Home.</p>