RoadFlow2.1 临时演示

AddApp.aspx 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddApp.aspx.cs" Inherits="WebForm.Platform.UserApp.AddApp" %>
  2. <!DOCTYPE html>
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6. <title></title>
  7. </head>
  8. <body>
  9. <form id="form1" runat="server">
  10. <br />
  11. <table cellpadding="0" cellspacing="1" border="0" width="99%" class="formtable">
  12. <tr>
  13. <th style="width:80px;">应用名称:</th>
  14. <td><input type="text" id="Name" name="Name" class="mytext" value="" validate="empty" style="width:75%" /></td>
  15. </tr>
  16. <tr>
  17. <th style="width:80px;">关联程序:</th>
  18. <td><select id="Type" name="Type" onchange="loadApp(this.value);" style="width:130px;" class="myselect" style="margin-right:5px"><option value=""></option><%=AppTypesOptions %></select>
  19. <select onclick="appidchange(this.value);" style="width:188px;" class="myselect" id="AppID" name="AppID"></select></td>
  20. </tr>
  21. <tr>
  22. <th style="width:80px;">相关参数:</th>
  23. <td><input type="text" id="Params" name="Params" value="" class="mytext" style="width:75%"/></td>
  24. </tr>
  25. <tr>
  26. <th style="width:80px;">图标:</th>
  27. <td><input type="text" name="Ico" id="Ico" class="myico" source="/Images/ico" value="" style="width: 75%"/></td>
  28. </tr>
  29. </table>
  30. <div class="buttondiv">
  31. <input type="submit" value="保存" class="mybutton" name="Save" onclick="return new RoadUI.Validate().validateForm(document.forms[0]);" />
  32. <input type="button" value="返回" class="mybutton" onclick="window.location='<%=Request.QueryString["Page"]%>'+'<%=Request.Url.Query%>';" />
  33. </div>
  34. </form>
  35. <script type="text/javascript">
  36. $(function ()
  37. {
  38. loadApp($("#Type").val());
  39. });
  40. function appidchange(value)
  41. {
  42. var options = $("#AppID option");
  43. for (var i = 0; i < options.length; i++)
  44. {
  45. if (value && options.eq(i).val() == value)
  46. {
  47. $("#Name").val(options.eq(i).text());
  48. }
  49. }
  50. }
  51. function loadApp(value)
  52. {
  53. if (!value)
  54. {
  55. return false;
  56. }
  57. $.ajax({ url: "GetApps.aspx", type: "post", data: { "type": value }, dataType: "text", async: false, cache: false, success: function (txt)
  58. {
  59. var $appid = $("#AppID");
  60. $("option", $appid).remove();
  61. $appid.append('<option value=""></option>'+txt);
  62. }
  63. });
  64. }
  65. </script>
  66. </body>
  67. </html>