title: How to choose search option then submit form in mvc razor
body: <p>My goal is to search employee in active directory and allow me to choose a search option in drop down.</p>
  
  <p><strong>For example:</strong> If I choose the <code>EmployeeNumber</code> the form with execute and search for <code>EmployeeNumber</code> that match in input box value. <em>-"<code>SamAccountName</code> is default search"</em> </p>
  
  <p><strong>Note:</strong> </p>
  
  <ul>
  <li>When I click the <code>EmployeeNumber</code> it should submit the form. </li>
  <li>The <code>SamAccountName</code> button is working.</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/ahU5r.jpg" alt="enter image description here"></p>
  
  <p><strong>Problem:</strong> How to use different submit or search option?</p>
  
  <pre><code>@using (Html.BeginForm("SystemPrepared", "Home", FormMethod.Get))
  {
      @Html.TextBox("spq", null, new { @class = "form-control", @placeholder = "Search..."})
      &lt;div class="input-group-btn"&gt;
          &lt;button class="btn btn-default" type="submit"&gt;SamAccountName&lt;/button&gt;
  
          &lt;button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"&gt;&lt;span class="caret"&gt;&lt;/span&gt;&lt;/button&gt;
          &lt;ul class="dropdown-menu" role="menu"&gt;
              &lt;li&gt;&lt;a href="#"&gt;SamAccountName&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;EmployeeNumber&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;GivenName&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Surname&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;EmailAddress&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Enable&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;GUID&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;SID&lt;/a&gt;&lt;/li&gt;                        
          &lt;/ul&gt;
  
      &lt;/div&gt;
  }
  </code></pre>
  
  <p><strong>What I've tried:</strong></p>
  
  <pre><code>&lt;li&gt;&lt;a href="?fltr=EmployeeNumber"&gt;EmployeeNumber&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>And get the value using request query string but the problem is the form din't submit and <code>spq</code> is empty or null.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Requested by Stephen</p>
  
  <pre><code>    public ActionResult SystemPrepared(string spq)
      {
          coockieActiveDirectory2 = db.ActiveDirectory2.Where(user =&gt;
                  user.SamAccountName.Contains(spq));
  
          return View(coockieActiveDirectory2);
      }
  </code></pre>
  
  <p>Currently this is just what I have in controller</p>