Microsoft .NET Server Solutions for the Enterprise
InspectBasket.asp from RemoteBasket.asp
When the new page InspectBasket.asp was created from a copy of the page RemoteBasket.asp, a number of additional changes where made to the routine htmRenderBasket. This section examines those changes by presenting an annotated version of the modified code in the page InspectBasket.asp.
The same conventions were used when annotating this version of the routine htmRenderBasket as were used in the previous section. Specifically:
- Annotations added to explain the changes are in italic font.
- Code that is new in the InspectBasket.asp version of htmRenderBasket is shown in bold font.
- To avoid the reading difficulty associated with wrapped lines of code, those lines have been truncated and are indicated with a bold ellipsis (...) at the point the line was truncated.
- To save unnecessary reading and trees, some whole sections of code that were not changed have been omitted, and are indicated by a vertical ellipsis and an annotation, as follows:
.
. Code that was not changed has been removed here.
.
- Some reformatting with respect to linefeeds has been done to enhance readability.
The new version of the routine htmRenderBasket that is used in the page InspectBasket.asp is based on the version in the page RemoteBasket.asp. The various differences are all based on the need to make the new version read-only. The versions of the routine htmRenderBasket that are in the pages basket.asp and RemoteBasket.asp contain a number of different controls and links that allow the contents of the basket to be altered. The main content of the basket page is rendered in an HTML table, where all of the rows other than the first row (the header row) and the last row (the sub-total row) are used to display individual products that are in the basket. Each of these product rows contains the following ways in which the contents of the basket can be altered:
- The text box that displays the quantity of the product can be edited and the associated update button can be clicked.
- The cell that displays the product ID is a link to the corresponding product page. Once on a product page, the entire catalog can be browsed, and new products can be added to the basket.
Note that code in the routine RenderBasketPage in the page InspectBasket.asp has been changed such that the left-side navigation link to the product catalog is not displayed.
- The final cell in each row displays a remove link that can be used to remove the corresponding product from the shopping basket.
Previous Next |