title: Using submit and text to pass a value to a controller
body: <p>I am a begginer with asp.net mvc 3.  I want to create a page where an user can enter a search item and retrieve the data from database.  I have created the database.  I have created the controller which is:</p>
  
  <pre><code>public ActionResult SearchIndex(string id)
  {
      string searchString=id;
      var search = from m in db.Searches
      select m;
  
      if (!String.IsNullOrEmpty(searchString))
      {
          search = search.Where(s =&gt; s.Name.Contains(searchString));
      }
  
      return View(search);
  }
  </code></pre>
  
  <p>I want to pass the value from view page to the above controller.  What should be the code in view page to enter an item to search from above mentioned controller?</p>