title: Open View in a Bootstrap modal asp.net mvc?
body: <pre><code>&lt;div class="modal fade" id="signup" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-url='@Url.Action("Register","Account")'&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" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                  &lt;h4 class="modal-title" id="H1"&gt;Sign Up&lt;/h4&gt;
              &lt;/div&gt;
              &lt;div class="modal-body" id="modalsignupbody"&gt;
  
              &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;/div&gt;
  &lt;/div&gt;
  
  
  
  &lt;button type="submit" id="SignUpbtn" class="btn btn-warning"&gt;Sign Up&lt;/button&gt;
  </code></pre>
  
  <p>CONTROLLER:</p>
  
  <pre><code> [AllowAnonymous]
      public ActionResult Register()
      {
          return PartialView("Register");
      }
  </code></pre>
  
  <p>JQUERY:</p>
  
  <pre><code>  $('#SignUpbtn').click(function () {
              var url = $('#signup').data('url');
  
              $.get(url, function (data) {
                  $('#modalsignupbody').html(data);
  
                  $('#signup').modal('show');
              });
          });
  </code></pre>
  
  <p>Please could someone help me with this? </p>
  
  <p><strong>ERROR:</strong> The Modal isn't opening the page just refreshes </p>
  
  <p>PARTIAL VIEW CODE:</p>
  
  <pre><code>  @model BrightFolio.Models.RegisterModel
  @{
      ViewBag.Title = "Register";
  }
  
  &lt;hgroup class="title"&gt;
      &lt;h1&gt;@ViewBag.Title.&lt;/h1&gt;
      &lt;h2&gt;Create a new account.&lt;/h2&gt;
  &lt;/hgroup&gt;
  
  @using (Html.BeginForm()) {
      @Html.AntiForgeryToken()
      @Html.ValidationSummary()
  
      &lt;fieldset&gt;
          &lt;legend&gt;Registration Form&lt;/legend&gt;
          &lt;ol&gt;
              &lt;li&gt;
                  @Html.LabelFor(m =&gt; m.UserName)
                  @Html.TextBoxFor(m =&gt; m.UserName)
              &lt;/li&gt;
              &lt;li&gt;
                  @Html.LabelFor(m =&gt; m.Password)
                  @Html.PasswordFor(m =&gt; m.Password)
              &lt;/li&gt;
              &lt;li&gt;
                  @Html.LabelFor(m =&gt; m.ConfirmPassword)
                  @Html.PasswordFor(m =&gt; m.ConfirmPassword)
              &lt;/li&gt;
          &lt;/ol&gt;
          &lt;input type="submit" value="Register" /&gt;
      &lt;/fieldset&gt;
  }
  
  @section Scripts {
      @Scripts.Render("~/bundles/jqueryval")
  }
  </code></pre>