Namespace.aspx 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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>Namespace</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 instance of the Person class
  13. and puts it in the "Demo" namespace.</p>
  14. <input id="Button1" value="Create Demo.Person"
  15. type="button" onclick="return OnButton1Click()" />
  16. </div>
  17. <script type="text/javascript" src="Namespace.js"></script>
  18. <script type="text/javascript" language="JavaScript">
  19. function OnButton1Click()
  20. {
  21. var testPerson = new Demo.Person(
  22. 'John', 'Smith', '[email protected]');
  23. alert(testPerson.getFirstName() + " " +
  24. testPerson.getLastName() );
  25. return false;
  26. }
  27. </script>
  28. </body>
  29. </html>