webrequest.aspx 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. <title> Using WebRequest </title>
  6. <style type="text/css">
  7. body { font: 11pt Trebuchet MS;
  8. font-color: #000000;
  9. padding-top: 72px;
  10. text-align: center }
  11. .text { font: 8pt Trebuchet MS }
  12. </style>
  13. </head>
  14. <body>
  15. <h2>Using WebRequest</h2>
  16. <form id="form1" runat="server">
  17. <asp:ScriptManager runat="server" ID="ScriptManagerId">
  18. <Scripts>
  19. <asp:ScriptReference Path="WebRequest.js" />
  20. </Scripts>
  21. </asp:ScriptManager>
  22. </form>
  23. <table>
  24. <tr align="left">
  25. <td>Make GET Request:</td>
  26. <td>
  27. <button id="Button1"
  28. onclick="GetWebRequest()">GET</button>
  29. </td>
  30. </tr>
  31. <tr align="left">
  32. <td>Request Body:</td>
  33. <td>
  34. <button id="Button2"
  35. onclick="PostWebRequest()">Body</button>
  36. </td>
  37. </tr>
  38. <tr align="left">
  39. <td>Request Timeout:</td>
  40. <td>
  41. <button id="Button3"
  42. onclick="WebRequestTimeout()">Timeout</button>
  43. </td>
  44. </tr>
  45. <tr align="left">
  46. <td>Request Completed Handler:</td>
  47. <td>
  48. <button id="Button4"
  49. onclick="WebRequestCompleted()">Completed Handler</button>
  50. </td>
  51. </tr>
  52. <tr align="left">
  53. <td>Resolved Url:</td>
  54. <td>
  55. <button id="Button5"
  56. onclick="GetWebRequestResolvedUrl()">Resolved Url</button>
  57. </td>
  58. </tr>
  59. <tr align="left">
  60. <td>Request Executor:</td>
  61. <td>
  62. <button id="Button6"
  63. onclick="WebRequestExecutor()">Executor</button>
  64. </td>
  65. </tr>
  66. <tr align="left">
  67. <td>Request Header:</td>
  68. <td>
  69. <button id="Button7"
  70. onclick="WebRequestHeader()">Header</button>
  71. </td>
  72. </tr>
  73. </table>
  74. <hr />
  75. <div id="ResultId" style="background-color:Aqua;"></div>
  76. </body>
  77. </html>