fork download
  1. @model MvcApplication6.Models.AuthForm
  2.  
  3. @{
  4. ViewBag.Title = "СЭЛФ";
  5. }
  6. @section home {
  7.  
  8. <div class="login-form">
  9. <fieldset>
  10. <legend>СЭЛФ Авторизация</legend>
  11. @using (Html.BeginForm("Auth", "Home", FormMethod.Post, new { @class = "form-horizontal" })) {
  12. <div class="control-group">
  13. <div class="controls">
  14. @Html.TextBoxFor(model => model.Login, new { @placeholder = "Введите Ваш логин" })
  15. </div>
  16. </div>
  17.  
  18. <div class="control-group">
  19. <div class="controls">
  20. @Html.PasswordFor(model => model.Password, new { @placeholder = "Введите Ваш пароль" })
  21. </div>
  22. </div>
  23.  
  24. <div class="control-group">
  25. <div class="controls">
  26. <button id="buttonAuth" type="submit" class="btn">Войти</button>
  27. </div>
  28. </div>
  29. }
  30. </fieldset>
  31. </div>
  32.  
  33. <!-- Modal -->
  34. <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  35. <div class="modal-header">
  36. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  37. <h3 id="myModalLabel">Modal header</h3>
  38. </div>
  39. <div class="modal-body">
  40. <p>One fine body…</p>
  41. </div>
  42. <div class="modal-footer">
  43. <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
  44. <button class="btn btn-primary">Save changes</button>
  45. </div>
  46. </div>
  47.  
  48. <script type="text/javascript">
  49.  
  50. $("form#auth").submit(function (e) {
  51. e.preventDefault();
  52. var login = $('input[id=login]').val();
  53. var password = $('input[id=password]').val();
  54.  
  55. $.ajax({
  56. url: "/Home/Auth",
  57. type: "POST",
  58. data: {
  59. Login: login,
  60. Password: password
  61. },
  62. dataType: 'json'
  63. })
  64. .success(function (responseValue) {
  65. $('#myModal').modal('show');
  66. });
  67. });
  68.  
  69. </script>
  70.  
  71. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty