title: How can I write a submit form using bootstrap modal?
body: <p>I'm using a bootstrap modal in asp.net mvc 5. But I'm having a problem with modal which I can't submit data. I have had call a _regiserPartial View form my _Layout (Master Page).</p>
  
  <p>my controller:</p>
  
  <pre><code>[HttpPost]
      public ActionResult Register(UserViewModel model)
      {
          var userViewModel = Mapper.Map&lt;UserViewModel, User&gt;(model);
          if (ModelState.IsValid)
          {
              userViewModel.Status = true;
              _userService.InsertUser(userViewModel);
              model = new UserViewModel();
          }
          return View(model);
      }
  </code></pre>
  
  <p>my _registerPrtial View:</p>
  
  <pre><code>@model HoiCode.Web.Models.Users.UserViewModel
  &lt;form class="form-horizontal"&gt;
  &lt;div id="registerModal" 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" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                  &lt;h4 class="modal-title"&gt;Resgister&lt;/h4&gt;
              &lt;/div&gt;
              @using (Html.BeginForm("Register", "User", FormMethod.Post))
              {
              @Html.AntiForgeryToken()
  
              &lt;div class="modal-body"&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label class="col-sm-4 control-label"&gt;@Html.LabelFor(m =&gt; m.Email)&lt;/label&gt;
                      &lt;div class="col-sm-8"&gt;
                          @Html.TextBoxFor(m =&gt; m.Email, new { @type = "email", @class = "form-control" })
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group"&gt;
                      &lt;label class="col-sm-4 control-label"&gt;@Html.LabelFor(m =&gt; m.Password)&lt;/label&gt;
                      &lt;div class="col-sm-8"&gt;
                          @Html.PasswordFor(m =&gt; m.Password, new { @class = "form-control" })
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                  &lt;button type="submit" class="btn btn-primary"&gt;Submit&lt;/button&gt;
              &lt;/div&gt;
              }
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function () {
      $('.launchRegisterModal').click(function () {
          $('#registerModal').modal({
              keyboard: false
          });
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>my _layout: I'll call _registerPartial from here </p>
  
  <pre><code>&lt;a href="#" class="launchLoginModal"&gt;Register&lt;/a&gt;
  </code></pre>