CallWebServiceMethods.aspx 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <%@ Page Language="C#" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head id="Head1" runat="server">
  5. <style type="text/css">
  6. body { font: 11pt Trebuchet MS;
  7. font-color: #000000;
  8. padding-top: 72px;
  9. text-align: center }
  10. .text { font: 8pt Trebuchet MS }
  11. </style>
  12. <title>Calling Web Methods</title>
  13. </head>
  14. <body>
  15. <form id="Form1" runat="server">
  16. <asp:ScriptManager runat="server" ID="scriptManagerId">
  17. <Scripts>
  18. <asp:ScriptReference Path="CallWebServiceMethods.js" />
  19. </Scripts>
  20. <Services>
  21. <asp:ServiceReference Path="WebService.asmx" />
  22. </Services>
  23. </asp:ScriptManager>
  24. <div>
  25. <h2>Calling Web Methods</h2>
  26. <table>
  27. <tr align="left">
  28. <td>Method that does not return a value:</td>
  29. <td>
  30. <!-- Getting no retun value from
  31. the Web service. -->
  32. <button id="Button1"
  33. onclick="GetNoReturn(); return false;">No Return</button>
  34. </td>
  35. </tr>
  36. <tr align="left">
  37. <td>Method that returns a value:</td>
  38. <td>
  39. <!-- Getting a retun value from
  40. the Web service. -->
  41. <button id="Button2"
  42. onclick="GetTime(); return false;">Server Time</button>
  43. </td>
  44. </tr>
  45. <tr align="left">
  46. <td>Method that takes parameters:</td>
  47. <td>
  48. <!-- Passing simple parameter types to
  49. the Web service. -->
  50. <button id="Button3"
  51. onclick="Add(20, 30); return false;">Add</button>
  52. </td>
  53. </tr>
  54. <tr align="left">
  55. <td>Method that returns XML data:</td>
  56. <td>
  57. <!-- Get Xml. -->
  58. <button id="Button4"
  59. onclick="GetXmlDocument(); return false;">Get Xml</button>
  60. </td>
  61. </tr>
  62. <tr align="left">
  63. <td>Method that uses GET:</td>
  64. <td>
  65. <!-- Making a GET Web request. -->
  66. <button id="Button5"
  67. onclick="MakeGetRequest(); return false;">Make GET Request</button>
  68. </td>
  69. </tr>
  70. </table>
  71. </div>
  72. </form>
  73. <hr/>
  74. <div>
  75. <span id="ResultId"></span>
  76. </div>
  77. </body>
  78. </html>