<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<head>
<title>Example Book 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 Books WHERE TitleId='" + Request.QueryString [ "titleid" ] + "'";
// fetch reader and bind to a formview
bookSpecs.DataSource = fetchReader ( query );
bookSpecs.DataBind ( );
}
</script>
<body style="margin:0">
<!-- #include file="books_header.inc" -->
<div align="center">
<form runat="server">
<asp:formview id="bookSpecs" runat="server"
width=70% enableviewstate=false>
<itemtemplate>
<div class="header"><h2 style="color:maroon"><%# Eval ( "title" ) %></h2></div>
<table cellpadding=10>
<tr>
<td valign="top">
<a href='<%# Eval ( "url" ) %>' target=books>
<img align="top" runat="server"
src='<%# Eval ( "titleid", "~/shared/books/lrg/{0}.jpg" ) %>'
style="width: 300; box-shadow: 3px 3px 6px gray" /></a>
</td>
<td valign="top">
<table>
<tr bgcolor="beige">
<td colspan=2 style="padding:10; border:2px inset">
<p><%# Eval ( "shortdesc" ) %></p>
</td>
</tr>
<tr><td><p> </p></td></tr>
<tr style="font-size:11pt">
<td width=40%>
<p><b>Category:</b> <%# Eval ( "subject" ) %></p>
<p><b>Title ID:</b> <%# Eval ( "titleid" ) %></p>
<p><b>Author:</b> <%# Eval ( "author" ) %></p>
<p><b>Publisher:</b> <%# Eval ( "publisher" ) %></p>
<p><b>Price:</b> <%# Eval ( "price", "{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>