?? productdetails.aspx
字號:
<%@ Page Language="vb" %>
<%@ Register TagPrefix="Conference" TagName="Header" Src="_Header.ascx" %>
<%@ Register TagPrefix="Conference" TagName="Menu" Src="_Menu.ascx" %>
<%@ OutputCache Duration="600"%>
<script language="VB" runat="server">
'*******************************************************
'
' The Page_Load event on this page is used to obtain
' product information from a database and then update
' UI elements with them.
'
' Note that this page is output cached at 1 minute
' intervals. This eliminates the need to hit the database
' on each request to the page.
'
' Other source code to examine:
' Conference.ProductDB.GetProductDetails() Method
'
'*******************************************************
Sub Page_Load(sender As Object, e As EventArgs)
' Obtain ProductID from QueryString
Dim ProductID As Integer = CInt(Request.Params("ProductID"))
' Obtain Product Details
Dim products As New Conference.ProductsDB
Dim myProductDetails As Conference.ProductDetails = products.GetProductDetails(ProductID)
' Update Controls with Product Details
desc.Text = myProductDetails.Description
UnitCost.Text = System.String.Format("{0:C}", myProductDetails.UnitCost)
ModelName.Text = myProductDetails.ModelName
ModelNumber.Text = myProductDetails.ModelNumber
' ProductImage.ImageUrl = "ProductImages/" & myProductDetails.ProductImage
addToCart.NavigateUrl = "AddToCart.aspx?ProductID=" & ProductID
' Obtain the detail of the sessions
Dim myProductSessions As Conference.ProductDetails
MyList2.DataSource = products.GetSessions(ProductID).Tables(0).DefaultView
MyList2.DataBind()
' Hide the header when no items are on the list
If MyList2.Items.Count = 0 Then
MyList2.Visible = False
End If
End Sub
</script>
<html>
<head>
<link rel="stylesheet" type="text/css" href="Conference.css">
</head>
<body background="images/sitebkgrd.gif" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginheight="0" marginwidth="0">
<!-- HEADER AND MENUS -->
<table width="100%" border=0>
<tr><td><Conference:Header runat="server"/></td></tr>
<tr><td>
<table width="100%" border=0>
<tr><td valign="top" width="200">
<Conference:Menu runat="server"/>
</td>
<td>
<!-- CONTENT -->
<table height="100%" valign="top" align="left" width="100%" border=0>
<tr><td>
<br>
</td></tr>
<tr><td class=ContentHeader>
<img align=left height="32" width="60" src="images/1x1.gif"><asp:Label id="ModelName" runat=server/><br>
</td></tr>
<tr><td>
<BR>
<asp:Label id="desc" runat="server"/><br><br>
</td></tr>
<tr><td>
<CENTER>
<asp:Repeater id="MyList2" runat="server">
<!-- Header of the template -->
<template name="HeaderTemplate">
<table height="100">
<tr>
<td class="BackgroundColor1" valign="bottom" align="center" height="56">
<H4><font face="Arial" color="#313179">description</font></h4>
</td>
<td class="BackgroundColor2" valign="bottom" align="center" height="56">
<H4><font face="Arial" color="#313179">author</font></h4>
</td>
<td class="BackgroundColor1" valign="bottom" align="center" height="56">
<H4><font face="Arial" color="#313179">date, time</font></H4>
</td>
<td class="BackgroundColor2" valign="bottom" align="center" height="56">
<H4><font face="Arial" color="#313179">duration</font></h4>
</td>
<td class="BackgroundColor1" valign="bottom" align="center" height="56">
<H4><font face="Arial" color="#313179">location</font></H4>
</td>
</tr>
</template>
<!-- Body of the template -->
<template name="ItemTemplate">
<tr>
<td height="21">
<%# Container.DataItem("Description") %>
</td>
<td height="21">
<%# Container.DataItem("Author") %>
</td>
<td height="21">
<%# Container.DataItem("Date").Format("g", DBNull) %>
</td>
<td height="21" align="center">
<%# Container.DataItem("Duration") %> hours
</td>
<td height="21">
<%# Container.DataItem("Location") %>
</td>
</tr>
</template>
<!-- Body of the template -->
<template name="AlternatingItemTemplate">
<tr>
<td class="BackgroundColor6" height="21">
<%# Container.DataItem("Description") %>
</td>
<td class="BackgroundColor5" height="21">
<%# Container.DataItem("Author") %>
</td>
<td class="BackgroundColor6" height="21">
<%# Container.DataItem("Date").Format("g", DBNull) %>
</td>
<td class="BackgroundColor5" height="21" align="center">
<%# Container.DataItem("Duration") %> hours
</td>
<td class="BackgroundColor6" height="21">
<!-- Add to cart action -->
<%# Container.DataItem("Location") %>
</td>
</tr>
</template>
<!-- Footer of the template -->
<template name="FooterTemplate">
</table>
</template>
</asp:Repeater>
</CENTER>
</td></tr>
<tr><td>
<table valign=top border=0>
<tr><td>
<br>
<span class=UnitCost>
<b>Price:</b> <asp:Label id="UnitCost" runat="server"></asp:Label>
</span>
<br>
<span class=ModelNumber>
<b>Conference Track Number:</b> <asp:Label id="ModelNumber" runat="server"></asp:Label>
</span><br>
<asp:HyperLink id="addToCart" Text="Add to Cart" runat="server"/>
</td></tr>
</table>
</td></tr>
</table>
<!-- END OF CONTENT -->
</td></tr>
</table>
</td></tr>
</table>
<!-- END OF HEADER AND MENU -->
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -