Noookpage.aspx


SUBMITTED BY: Guest

DATE: Feb. 14, 2014, 5:35 p.m.

FORMAT: HTML

SIZE: 4.5 kB

HITS: 1237

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="BookPage.aspx.cs" Inherits="BookPage" %>
  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>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title></title>
  7. <link href="BookPage.css" rel="stylesheet" type="text/css" />
  8. <script type="text/javascript">
  9. window.onload = function () {
  10. var bookId = '<%=Session["BookId"]%>' - 1;
  11. displayBookInfo(bookId);
  12. }
  13. if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
  14. xmlhttp = new XMLHttpRequest();
  15. }
  16. else {// code for IE6, IE5
  17. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  18. }
  19. xmlhttp.open("GET", "Books.xml", false);
  20. xmlhttp.send();
  21. xmlDoc = xmlhttp.responseXML;
  22. x = xmlDoc.getElementsByTagName("Book");
  23. function displayBookInfo(i) {
  24. title = (x[i].getElementsByTagName("Title")[0].childNodes[0].nodeValue);
  25. author = (x[i].getElementsByTagName("Author")[0].childNodes[0].nodeValue);
  26. publishDate = (x[i].getElementsByTagName("PublishDate")[0].childNodes[0].nodeValue);
  27. genre = (x[i].getElementsByTagName("Genre")[0].childNodes[0].nodeValue);
  28. picurl = (x[i].getElementsByTagName("PictureUrl")[0].childNodes[0].nodeValue);
  29. price = (x[i].getElementsByTagName("Price")[0].childNodes[0].nodeValue);
  30. stock = (x[i].getElementsByTagName("Stock")[0].childNodes[0].nodeValue);
  31. summary = (x[i].getElementsByTagName("Summary")[0].childNodes[0].nodeValue);
  32. getTitle = "<h1>" + title + "</h1>";
  33. getAuthor = "<h2>By " + author + "</h2>";
  34. getGenre = "<li>Genre: " + genre + "</li>";
  35. getDate = "<li>Publication: " + publishDate + "</li>";
  36. getPrice = "<li>Price: " + price + " Shekels</li>";
  37. getStock = "";
  38. if (stock > 0) {
  39. getStock = "<li>This item is in stock</li>";
  40. }
  41. else {
  42. getStock = "<li>This item is not in stock</li>";
  43. }
  44. getSummary = "<p>" + summary + "</p>";
  45. document.getElementById("ShowTitle").innerHTML = getTitle;
  46. document.getElementById("ShowAuthor").innerHTML = getAuthor;
  47. document.getElementById("ShowGenre").innerHTML = getGenre;
  48. document.getElementById("ShowPublishDate").innerHTML = getDate;
  49. document.getElementById("ShowPrice").innerHTML = getPrice;
  50. document.getElementById("ShowStock").innerHTML = getStock;
  51. document.getElementById("ShowSummary").innerHTML = getSummary;
  52. }
  53. </script>
  54. </head>
  55. <body>
  56. <center>
  57. <img border="0" alt="" src="Header.png" />
  58. <div id="bookpage_container" style="text-align:left;">
  59. <div id="bookpage_menu" style="padding-left: 100px">
  60. <ul>
  61. <li><a href="Default.aspx">Home</a></li>
  62. <li><a href="#">Search</a></li>
  63. <li><a href="Catalog.aspx" class="current">Books</a></li>
  64. <li><a href="#">Company</a></li>
  65. <li><a href="#">Contact</a></li>
  66. </ul>
  67. </div>
  68. </div>
  69. </center>
  70. <div id="bookpage_content_right" style="padding-left: 270px">
  71. <div id='ShowTitle' >title here</div>
  72. <div class="image_panel"><img src="Pictures/Catch22.jpg" alt="" width="100" height="150" /></div>
  73. <div id='ShowAuthor' >author here</div>
  74. <ul>
  75. <div id='ShowGenre' >genre here</div>
  76. <div id='ShowPublishDate' >date here</div>
  77. <div id='ShowPrice' >price here</div>
  78. <div id='ShowStock' >stock here</div>
  79. </ul>
  80. </div>
  81. <center>
  82. <div id="ShowSummary" style="text-align:left; width:57%;">
  83. Show Summary here
  84. </div>
  85. </center>
  86. </body>
  87. </html>

comments powered by Disqus