<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<head>
<title>Example Title Details Page</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server" src="fetchData_sql.cs" />
<script language="C#" runat="server">
void Page_Load ( Object src, EventArgs e ) {
// define the query
string query = "SELECT * FROM Titles where title_id='" +
Request.QueryString [ "titleid" ] + "'";
// fetch reader and bind to a formview
titleSpecs.DataSource = fetchReader ( query );
titleSpecs.DataBind ( );
}
</script>
<body style="margin:0">
<!-- #include file="books_header.inc" -->
<div align="center">
<form runat="center">
<asp:formview id="titleSpecs" runat="server"
width=60% enableviewstate=false>
<itemtemplate>
<div class="header"><h2 style="color:maroon"><%# Eval ( "title" ) %></h2></div>
<table cellpadding=10>
<tr>
<td valign="top">
<img align="top" runat="server"
src='<%# Eval ( "title_id", "~/shared/images/title-{0}.gif" ) %>'
style="width:130; box-shadow: 3px 3px 6px gray" />
</td>
<td valign="top">
<table>
<tr bgcolor="beige">
<td colspan=2 style="padding:10; border:2px inset">
<p><%# Eval ( "notes" ) %></p>
</td>
</tr>
<tr><td><p> </p></td></tr>
<tr style="font-size:11pt">
<td width=40%>
<p><b>Category:</b> <%# Eval ( "type" ) %></p>
<p><b>Publisher ID:</b> <%# Eval ( "pub_id" ) %></p>
<p><b>Price:</b> <%# Eval ( "price", "{0:c}" ) %></p>
</td>
<td width=60%>
<p><b>Title ID:</b> <%# Eval ( "title_id" ) %></p>
<p><b>Published:</b> <%# Eval ( "pubdate", "{0:d}" ) %></p>
<p><b>Year-To-Date Sales:</b> <%# Eval ( "ytd_sales", "{0:c}" ) %></p>
</td>
</tr>
</table>
</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>