title: How to clear text from a search textbox after search is complete in MVC
body: <p>I have two dropdown lists and two textboxes</p>
  
  <pre><code>Search By: ByHtml.DropDownList("Search1", "Please Select...")
          Html.TextBox("searchString1")    
  
  Search By: Html.DropDownList("Search2", "Please Select...")
          @Html.TextBox("searchString2")
  
          &lt;input type="submit" value="Filter" /&gt;
  </code></pre>
  
  <p>When I make my selection from whichever DDL and type text into the textbox and hit filter my search returns, however after the search the text remains in the textbox, is there a way of clearing it after the search so that the textbox is empty again? I tried </p>
  
  <pre><code>ModelState.Remove("");
  </code></pre>
  
  <p>but it didn't work.</p>
  
  <p>A sample from My controller code is</p>
  
  <pre><code>public class MainController : Controller
  {
      private DBEntities db = new DBEntities();
  
      // GET: /Main/
      public ActionResult Index(string searchString1, string searchString2, string Search1, string Search2)
      {
         //Create a Dropdown list
          var SearchOptionList = new List&lt;string&gt;();
          SearchOptionList.Add("LandLord");
          SearchOptionList.Add("Postcode");
          SearchOptionList.Add("Street Address");
          ViewBag.Search1 = new SelectList(SearchOptionList);
          ViewBag.Search2 = new SelectList(SearchOptionList);
  
  var mylist = from m in "mydatabase" select m;
  
  //This statement runs if the user selects a parameter from Search2 and leaves Search1 empty
          if (String.IsNullOrEmpty(Search1) &amp;&amp; !String.IsNullOrEmpty(Search2))
          {
              if (Search2 == "Postcode")
              {
                  mylist = mylist.Where(s =&gt; s.Postcode.Contains(searchString2));
              }
              if (Search2 == "LandLord")
              {
                  mylist = mylist.Where(s =&gt; s.Name.Contains(searchString2));
              }
              if (Search2 == "Street Address")
              {
                  mylist = mylist.Where(s =&gt; s.StreetAddress.Contains(searchString2));
              }
          }
  
    return View(mylist.ToList());
  </code></pre>
  
  <p>}</p>