Enumeration.aspx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <title>Enumeration</title>
  6. </head>
  7. <body>
  8. <form id="Main" runat="server">
  9. <asp:ScriptManager runat="server" ID="scriptManager" />
  10. </form>
  11. <div>
  12. <p>This example creates an Enumeration of colors
  13. and applies them to page background.</p>
  14. <select id="ColorPicker"
  15. onchange="ChangeColor(options[selectedIndex].value)">
  16. <option value="Red" label="Red">Red</option>
  17. <option value="Blue" label="Blue">Blue</option>
  18. <option value="Green" label="Green">Green</option>
  19. <option value="White" label="White">White</option>
  20. </select>
  21. </div>
  22. <script type="text/javascript" src="Enumeration.js"></script>
  23. <script type="text/javascript" language="JavaScript">
  24. function ChangeColor(value)
  25. {
  26. document.body.bgColor = eval("Demo.Color." + value + ";");
  27. }
  28. </script>
  29. </body>
  30. </html>