title: ASP MVC best method to search/return all values from database
body: <p>In the case of a default value being used in an ASP MVC drown down list, I need the code to return all values or simply ignore that particular search criteria. </p>
  
  <p>Below is the code I have in my View and Controller. Since the '%' does not seem to be working, is there another keyword/operator that will do the job? </p>
  
  <p>View:</p>
  
  <pre><code>        &lt;form method="post"&gt;
            &lt;select name="Table" title="Table" style="font-size:8pt;"&gt;
              &lt;option value="%"&gt;--Table Name--&lt;/option&gt;
              &lt;option value="AgentContEd"&gt;CE&lt;/option&gt;
              &lt;option value="AgentProductTraining"&gt;PT&lt;/option&gt;
            &lt;/select&gt;
            &lt;select name="IssueType" style="font-size:8pt;"&gt;
              &lt;option value="%"&gt;--Issue Type--&lt;/option&gt;
              &lt;option value="W"&gt;Warning&lt;/option&gt;
              &lt;option value="E"&gt;Error&lt;/option&gt;
            &lt;/select&gt;
            &lt;select name="Status" style="font-size:8pt;"&gt;
              &lt;option value="%"&gt;--Status Type--&lt;/option&gt;
              &lt;option value="O"&gt;Open&lt;/option&gt;
              &lt;option value="U"&gt;Under Review&lt;/option&gt;
            &lt;/select&gt;
  
  
          &lt;input type="image" src="@Url.Content("~/Content/Images/Filter.bmp")" alt="Filter" style="padding-top: 0px;" /&gt;
          &lt;a href="#" style="padding-left: 30px;"&gt;&lt;/a&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>Controller: </p>
  
  <pre><code>    public ViewResult Index(FormCollection dropDownSelection)
      {
          //security
          //if (!Security.IsViewer(User)) return RedirectToAction("Message", "Home", new { id = 2 });
  
          //if (ViewBag.Level == 0) return RedirectToAction("Message", "Home", new { id = 2 });
  
          string table = dropDownSelection["Table"];
          string issue = dropDownSelection["IssueType"];
          string status = dropDownSelection["Status"];
  
          var followUpItem = from follow in db.FollowUpItems
                             where follow.TableName.Equals(table) &amp;&amp;
                                   follow.IssueType.Equals(issue) &amp;&amp;
                                   follow.Status.Equals(status)
                             select follow;
  
          return View(followUpItem.ToList());
      }
  </code></pre>