Advertisement
Guest User

Untitled

a guest
Jan 12th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. MVC3 Ajax.begin form works in chrome and IE, but not firefox?
  2. @using Infragistics.Web.Mvc
  3. @model FuelPortal.Models.ViewModels.UserMaintenanceViewModel
  4.  
  5. @*changed this div and ajax update from wrapperData to wrapperData because having it as wrapperData was screwing up the JS on user submit, it had two of the same id's...*@
  6. <style type="text/css">
  7. input[type=text]
  8. {
  9. margin-bottom: 10px;
  10. }
  11.  
  12. .disabled
  13. {
  14. background-color: #CECECE !important;
  15. background-image: url('') !important;
  16. }
  17. </style>
  18. <script src="../../Scripts/jquery.unobtrusive-ajax.min.js" type="text/javascript"></script>
  19. <div id="wrapperData2">
  20. <!-- jared's table thingymabobber starts here yo -->
  21. @if (Model != null)
  22. {
  23. <div class='frmBG'>
  24. <table width='100%' style='margin-top: 10px'>
  25. @using (Ajax.BeginForm("DetailUser", new AjaxOptions { UpdateTargetId = "wrapperData2", InsertionMode = InsertionMode.Replace, HttpMethod = "POST" }))
  26. {
  27.  
  28. <tr>
  29. <td><b>First Name:</b></td>
  30. <td>@Html.TextBoxFor(mbox => mbox.User.firstName)</td>
  31. </tr>
  32. <tr>
  33. <td><b>Last Name:</b></td>
  34. <td>@Html.TextBoxFor(mbox => mbox.User.lastName)</td>
  35. </tr>
  36. <tr>
  37. <td><b>Email:</b></td>
  38. <td>@Html.TextBoxFor(mbox => mbox.User.email)</td>
  39. </tr>
  40. <tr>
  41. <td><b>Username:</b></td>
  42. <td>@Html.TextBoxFor(mbox => mbox.User.userName, new {@readonly="true", @class="disabled"})</td>
  43. </tr>
  44. <tr>
  45. <td><b>Phone:</b></td>
  46. <td>@Html.TextBoxFor(mbox => mbox.User.phone)</td>
  47. </tr>
  48. <tr>
  49. <td><b>Account Expiration Date:</b></td>
  50. <td>@Html.TextBoxFor(mbox => mbox.User.expireDate)</td>
  51. </tr>
  52. <tr>
  53. <td>@Html.HiddenFor(mbox => mbox.User.LoginAccountId)</td>
  54. <td><input type="submit" value='Save' /></td>
  55. </tr>
  56.  
  57. }
  58. </table>
  59. </div>
  60. }
  61. </div>
  62.  
  63. //view details
  64. public ActionResult DetailUser(int id)
  65. {
  66. UserMaintenanceViewModel model = new UserMaintenanceViewModel();
  67. model = repository.getUserById(Session["UserId"].ToString(), id);
  68.  
  69. return PartialView("_ViewUserDetail", model);
  70.  
  71. }
  72.  
  73. [HttpPost]
  74. public ActionResult DetailUser(int id, UserMaintenanceViewModel model)
  75. {
  76. var test = model.User.LoginAccountId;
  77. var test2 = model.User.firstName;
  78. var result = repository.updateUser(model.User);
  79. return PartialView("_ViewUserDetail", model);
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement