title: ASP.Net MVC Show/Hide Content
body: <p>Ok I have the following View</p>
  
  <pre><code>@model IEnumerable&lt;WebApplication3.Models.user&gt;
  
  @{
      ViewBag.Title = "Password Management";
      Layout = "~/Views/Shared/_Layout.cshtml";
  }
  
  @section title {&lt;h1&gt;@ViewBag.Title&lt;/h1&gt;}
  
  &lt;div id="page-block" class="page-block-three row"&gt;
  
      &lt;div style="margin-top: 30px;" class="col-lg-offset-2 col-lg-8"&gt;
          @using (Html.BeginForm())
          {
              &lt;div class="input-group"&gt;
                  @Html.TextBox("SearchString", null, new { @class = "form-control ccl-form", @style = "z-index: 10", @placeholder = "Enter Username"})
                  &lt;div class="input-group-btn"&gt;
                      &lt;button class="btn ccl-btn ccl-btn-red ccl-btn-search" type="submit"&gt;&lt;i class="fa fa-search"&gt;&lt;/i&gt;&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          }
      &lt;/div&gt;
  
      &lt;div class="col-lg-offset-3 col-lg-6"&gt;
          @foreach (var item in Model)
          {
              &lt;div class="details-block"&gt;
                  @Html.DisplayFor(modelItem =&gt; item.UserName)
                  &lt;button type="button" class="btn ccl-btn ccl-btn-green ccl-btn-search pull-right"&gt;Select User&lt;/button&gt;
              &lt;/div&gt;
  
          }
      &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>What I want to be able to do is hide the following div</p>
  
  <pre><code>&lt;div class="col-lg-offset-3 col-lg-6"&gt;
          @foreach (var item in Model)
          {
              &lt;div class="details-block"&gt;
                  @Html.DisplayFor(modelItem =&gt; item.UserName)
                  &lt;button type="button" class="btn ccl-btn ccl-btn-green ccl-btn-search pull-right"&gt;Select User&lt;/button&gt;
              &lt;/div&gt;
  
          }
      &lt;/div&gt;
  </code></pre>
  
  <p>Then show that Div when the submit button is clicked</p>
  
  <p>My Controller looks like the following</p>
  
  <pre><code>public class PasswordController : Controller
      {
          private CCLPasswordManagementDBEntities db = new CCLPasswordManagementDBEntities();
  
          public ActionResult Search(string searchString)
          {
              var users = from x in db.users select x;
  
              if (!String.IsNullOrEmpty(searchString))
              {
                  users = users.Where(x =&gt; x.UserName.ToUpper().Contains(searchString.ToUpper()));
              }
  
              return View(users);
          }
  
      }
  </code></pre>
  
  <p>At the moment the div is constantly shown and updates when the submit button is pressed but I want to hide that div until someone presses the submit button then it can show.</p>
  
  <p>Thanks in advance for the help.</p>