title: Get form-values from HTTP-get?
body: <p>I'm using ASP.NET adn have the following code in my view:</p>
  
  <pre><code>&lt;% using(Html.BeginForm("Search", "Home", FormMethod.Get)) { %&gt;
  
  &lt;%= Html.TextBox("searchText") %&gt;
  &lt;input type="submit" value="Search" /&gt;
  
  &lt;% } %&gt;
  </code></pre>
  
  <p>and in my controller I have:</p>
  
  <pre><code>    public ActionResult Search(string searchText)
      {
         return View("Index");
      }
  </code></pre>
  
  <p>If I have a breakpoint in the Search-action and examine the searchText argument it's always "" even if I type some text in the texbox. If I change the formmethod to POST it works as expected.</p>
  
  <p>How can I read "searchText" when using http-GET? </p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I had the following route</p>
  
  <pre><code>       routes.MapRoute(
              "Search",                                              // Route name
              "Search/{searchText}",                           // URL with parameters
              new { controller = "Home", action = "Search", searchText ="" }  // Parameter defaults
          );
  </code></pre>
  
  <p>and when I removed the default value of searchText(searchValue=""), then I got the correct value in my action. Why?</p>