title: Html.ValidationSummary Twitter Bootstrap Modal not working
body: <p>this section of code does not work.</p>
  
  <pre><code>        @if (ViewData.ModelState.Any(x =&gt; x.Value.Errors.Any()))
      {
      &lt;div class="modal fade"&gt;
          &lt;div class="modal-dialog"&gt;
              &lt;div class="modal-content"&gt;
                  &lt;div class="modal-header"&gt;
                      &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt;
                      &lt;h4 class="modal-title"&gt;Validation Errors&lt;/h4&gt;
                  &lt;/div&gt;
                  &lt;div class="modal-body"&gt;
                      @Html.ValidationSummary()
                  &lt;/div&gt;
                  &lt;div class="modal-footer"&gt;
                      &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                      &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;&lt;!-- /.modal-content --&gt;
          &lt;/div&gt;&lt;!-- /.modal-dialog --&gt;
      &lt;/div&gt;&lt;!-- /.modal --&gt;
      }
  </code></pre>
  
  <p>But this does/ You can't dismiss the alert but it pops up!</p>
  
  <pre><code>@if (ViewData.ModelState.Any(x =&gt; x.Value.Errors.Any()))
  {
  &lt;div class="alert alert-danger"&gt;
      &lt;a href="#" class="close" data-dismiss="alert"&gt;×&lt;/a&gt;
      &lt;h4&gt;Validation Errors&lt;/h4&gt;
      @Html.ValidationSummary()
  &lt;/div&gt;
  }
  </code></pre>
  
  <p>Im using exactly the same validation Razor code each time. &amp; i'm not sure if i should be seeing things happen in the chrome developer toolkit or not. </p>
  
  <p>EDIT:
  Here is the complete page.</p>
  
  <pre><code>@using Project.Models
  @model LoginViewModel
  @{
  ViewBag.Title = "Log in";
  Layout = "";
  }
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;meta content="width=device-width, initial-scale=1.0" name="viewport"&gt;
  &lt;title&gt;@ViewBag.Title&lt;/title&gt;
  @Styles.Render("~/Content/css")
  
   &lt;!--[if lt IE 9]&gt;
   &lt;script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"&gt;&lt;/script&gt;
   &lt;script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"&gt;&lt;/script&gt;
   &lt;![endif]--&gt;
  
  &lt;/head&gt;
   &lt;body class="login-page"&gt;
               @if (ViewData.ModelState.Any(x =&gt; x.Value.Errors.Any()))
               {
                  &lt;div class="modal fade" id="ValidationSummaryModal"&gt;
                      &lt;div class="modal-dialog"&gt;
                          &lt;div class="modal-content"&gt;
                              &lt;div class="modal-header"&gt;
                                  &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span     aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt;
                                  &lt;h4 class="modal-title"&gt;Validation Errors&lt;/h4&gt;
                              &lt;/div&gt;
                              &lt;div class="modal-body"&gt;
                                  @Html.ValidationSummary()
                              &lt;/div&gt;
                              &lt;div class="modal-footer"&gt;
                                  &lt;button type="button" class="btn btn-default" data-    dismiss="modal"&gt;Close&lt;/button&gt;
                                  &lt;button type="button" class="btn btn-primary"&gt;Save     changes&lt;/button&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;&lt;!-- /.modal-content --&gt;
                      &lt;/div&gt;&lt;!-- /.modal-dialog --&gt;
                  &lt;/div&gt;&lt;!-- /.modal --&gt;
      }
      &lt;div class="login-box"&gt;
          @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl },     FormMethod.Post, new { role = "form" }))
          {
              @Html.AntiForgeryToken()
              &lt;div class="login-box-title red"&gt;
                  @ViewBag.Title
              &lt;/div&gt;
              &lt;div class="login-box-content"&gt;
                  @Html.TextBoxFor(m =&gt; m.Email, new { @placeholder = "Email" })
                  @Html.TextBoxFor(m =&gt; m.Password, new { @placeholder = "Password",    @type="password" })
                  &lt;input id="submit" name="submit" type="submit" value="Sign in!"&gt;
                  &lt;div class="half"&gt;
                      @Html.ActionLink("Forgot your password?", "ForgotPassword")
                  &lt;/div&gt;
                  &lt;div class="half last"&gt;
                      @Html.ActionLink("Sign Up!", "Register")
                  &lt;/div&gt;
              &lt;/div&gt;
          }
      &lt;/div&gt;
          @Scripts.Render("~/bundles/jquery")
          @Scripts.Render("~/bundles/bootstrap")
      &lt;script type="text/javascript"&gt;
          $(window).load(function () {
              $('#ValidationSummaryModal').modal('show');
          });
      &lt;/script&gt;
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>