Form.cshtml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. @{;
  2. ViewBag.Title = "表单页面";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <script>
  6. var keyValue = request('keyValue');
  7. $(function () {
  8. initControl();
  9. });
  10. //初始化控件
  11. function initControl() {
  12. //获取表单
  13. if (!!keyValue) {
  14. $.SetForm({
  15. url: "../../BaseManage/Tk_Gallery/GetFormJson",
  16. param: { keyValue: keyValue },
  17. success: function (data) {
  18. $("#form1").SetWebControls(data);
  19. }
  20. })
  21. }
  22. }
  23. //保存表单;
  24. function AcceptClick() {
  25. if (!$('#form1').Validform()) {
  26. return false;
  27. }
  28. var postData = $("#form1").GetWebControls(keyValue);
  29. $.SaveForm({
  30. url: "../../BaseManage/Tk_Gallery/SaveForm?keyValue=" + keyValue,
  31. param: postData,
  32. loading: "正在保存数据...",
  33. success: function () {
  34. $.currentIframe().$("#gridTable").trigger("reloadGrid");
  35. }
  36. })
  37. }
  38. </script>
  39. <div style="margin-top: 20px; margin-right: 30px;">
  40. <table class="form">
  41. <tr>
  42. <td class="formTitle">是否压缩</td>
  43. <td class="formValue">
  44. <input id="IsPicZip" type="text" class="form-control" />
  45. </td>
  46. </tr>
  47. <tr>
  48. <td class="formTitle">排序码</td>
  49. <td class="formValue">
  50. <input id="SortCode" type="text" class="form-control" />
  51. </td>
  52. </tr>
  53. <tr>
  54. <td class="formTitle">SEO关键字</td>
  55. <td class="formValue">
  56. <input id="SeoKey" type="text" class="form-control" />
  57. </td>
  58. </tr>
  59. <tr>
  60. <td class="formTitle">备注</td>
  61. <td class="formValue">
  62. <input id="Reamrk" type="text" class="form-control" />
  63. </td>
  64. </tr>
  65. <tr>
  66. <td class="formTitle">热门期数</td>
  67. <td class="formValue">
  68. <input id="HotNumber" type="text" class="form-control" />
  69. </td>
  70. </tr>
  71. <tr>
  72. <td class="formTitle">图库名称</td>
  73. <td class="formValue">
  74. <input id="GalleryName" type="text" class="form-control" />
  75. </td>
  76. </tr>
  77. </table>
  78. </div>