<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<html>
<head>
<title>Example Product Details Page</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<style type="text/css">
.model {
width:100%; height:18pt;
font:bold 13pt verdana; color:steelblue;
filter:shadow ( color=#cccccc ); padding-left:8}
.desc {
font:bold 11pt arial,verdana,sans-serif; background:khaki;
border:1px inset; padding:10; margin-bottom:10}
.specs {
font-size:9pt; background:beige;
border:1px inset; padding-right:5}
</style>
<script language="C#" runat="server" src="fetchData_oledb.cs" />
<script runat="server">
void Page_Load ( Object src, EventArgs e ) {
// define the query
string query = "SELECT * FROM Products where ProductID='" +
Request.QueryString [ "id" ] + "'";
// fetch reader and bind to a datalist
prodSpecs.DataSource = fetchReader ( query, "gear" );
prodSpecs.DataBind ( );
}
</script>
</head>
<body>
<!-- #include virtual="~/shared/top.inc" -->
<div class="header"><h2>Example Product Details Page</h2></div>
<br>
<div class="small"><a onMouseOver="status='Back to List';return true" href="javascript:history.go ( -1 )">Back to List</a></div>
<hr size=1 width=92%>
<div align="center">
<form runat="server">
<asp:formview id="prodSpecs" runat="server"
width=90% enableviewstate=false>
<itemtemplate>
<table width=100% cellpadding=8>
<tr valign="top">
<td colspan=2>
<div class="model">
<%# Eval ( "Brand" ) %>
<%# Eval ( "Model" ) %>
<span style="color:#600">
<%# Eval ( "Price", "{0:c}" ) %>
</span>
</div>
</td></tr>
<tr valign="top">
<td width=30% align="center">
<img runat="server"
src='<%# Eval ( "ProductID", "~/shared/images/gear/{0}.jpg" ) %>'
alt='<%# Eval ( "Model" ) %>'
width=220 height=220 border=0>
<br>
<table width=95% class="data" cellspacing=1 style="font-size:8pt; background:slategray">
<tr>
<th align="right">Stock ID: </th>
<td><%# Eval ( "ProductID" ) %></td></tr>
<tr>
<th align="right">Category: </th>
<td><%# Eval ( "Category" ) %></td></tr>
<tr>
<th align="right">Group: </th>
<td><%# Eval ( "Type" ) %></td></tr>
<tr>
<th align="right">Type: </th>
<td><%# Eval ( "SubType" ) %></td></tr>
</table>
</td>
<td>
<div class="desc">
<%# Eval ( "Description" ) %>
</div>
<div class="specs">
<%# Eval ( "Specs" ) %>
</div>
</td></tr>
</table>
</itemtemplate>
</asp:formview>
</form>
</div>
<hr size=1 width=92%>
<div class="small"><a onMouseOver="status='Back to List';return true" href="javascript:history.go ( -1 )">Back to List</a></div>
<br>
</body>
</html>