title: ASP.net LINQ: return items where id equals a variable
body: <p>I use asp.net c# with webforms and I work with the dal+bll structure. This is my situation:</p>
  
  <p>I have a starting page with 8 buttons, when I click on one of this buttons, I go to a page list.aspx.</p>
  
  <p>On this page, there is data returned from the database with this LINQ code:</p>
  
  <pre><code>    var result = (from b in dc.Businesses
                    select b).ToList();
      return result;
  </code></pre>
  
  <p>This all works as it should. However, I want to make it so that if I click on button1, only the records with businessType "NighShop" are returned. When I click on button2, only records with idName "Bar" are returned etc. It would be stupid to make 8 different pages + DAL&amp;BLL's for this.</p>
  
  <p>So I figure the LINQ (in the DALBusiness.cs class layer) should be something like this:</p>
  
  <pre><code>    var result = (from b in dc.Businesses where b.BusinessType == aVariableValue
                    select b).ToList();
      return result;
  </code></pre>
  
  <p>And that variableValue can be altered whenever the user presses one of the 8 buttons. But I have no experience with this, so I don't know how to do this.</p>
  
  <p>I tried to declare the var when I press on a button (on index page): </p>
  
  <pre><code>public void Button1_Click(object sender, EventArgs e)
  {
      var keuze = "Nachtwinkel";
  }
  </code></pre>
  
  <p>But if I try:</p>
  
  <pre><code>public IList&lt;Business&gt; selectAll()
  {
      var result = (from b in dc.Businesses where b.BusinessType == keuze
                    select b).ToList();
      return result;
  }
  </code></pre>
  
  <p>On theDALBusiness.cs class layer, then it doesn't know the var keuze. I'm new to asp.net, so the answer might be really easy after all.</p>