Default.aspx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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>EventHandlerList Example</title>
  6. </head>
  7. <body>
  8. <form id="form1" runat="server">
  9. <div id="ResultDisplay"></div>
  10. <asp:ScriptManager runat="server" ID="ScriptManager01">
  11. <scripts>
  12. <asp:ScriptReference Path="HoverButton.js" />
  13. </scripts>
  14. </asp:ScriptManager>
  15. <script type="text/javascript">
  16. var app = Sys.Application;
  17. // Add the handler function to the pageLoad event.
  18. app.add_load(applicationLoadHandler);
  19. function applicationLoadHandler(sender, args) {
  20. $create(
  21. Demo.HoverButton,
  22. {element: {style: {borderWidth: "2px"}}},
  23. // Bind the start function to the click event.
  24. {click: start},
  25. null,
  26. $get('Button1')
  27. );
  28. }
  29. function start(sender, args) {
  30. alert("The start function handled the HoverButton click event.");
  31. }
  32. </script>
  33. <button type="button" id="Button1" value="HoverButton">
  34. HoverButton
  35. </button>
  36. </form>
  37. </body>
  38. </html>