<html>
<head>
<title>DetailsView with Default Paging</title>
<link rel="stylesheet" href="/shared/netdemos.css">
</head>
<body>
<!-- #include virtual="~/shared/top.inc" -->
<div class="header"><h2>DetailsView with Default Paging</h2></div>
<hr size=1 width=92%>
<div align="center">
<form runat="server">
<p>Select Designer:
<asp:dropdownlist id="planDesign" runat="server"
datasourceid="designers"
datatextfield="Design"
autopostback /></p>
<asp:detailsview id="planDetails" runat="server"
datasourceid="plans"
width="80%" cellpadding=5 font-size="9pt"
autogeneraterows=false
allowpaging>
<fieldheaderstyle width=30%
backcolor="aliceblue" font-bold />
<rowstyle verticalalign="top" />
<fields>
<asp:boundfield headertext="Plan"
datafield="PlanId" />
<asp:boundfield headertext="Model"
datafield="Model" />
<asp:boundfield headertext="Description"
datafield="Description" />
<asp:templatefield headertext="Features">
<itemtemplate>
<asp:label runat="server"
text='<%# Eval ( "Features" ) %>' />
</itemtemplate>
</asp:templatefield>
<asp:templatefield headertext="Specs">
<itemtemplate>
<asp:label runat="server"
text='<%# Eval ( "Specs" ) %>' />
</itemtemplate>
</asp:templatefield>
<asp:boundfield headertext="Foundation"
datafield="Foundation" />
<asp:boundfield headertext="Area"
datafield="Area"
dataformatstring="{0:n0} sq. ft."
htmlencode=false
itemstyle-horizontalalign="right" />
<asp:boundfield headertext="National Average Cost to Build"
datafield="Cost"
dataformatstring="{0:c}"
htmlencode=false
itemstyle-horizontalalign="right" />
<asp:imagefield headertext="Image"
dataimageurlfield="PlanId"
dataimageurlformatstring="~/shared/images/plans/{0}.jpg"
dataalternatetextfield="Model"
readonly="true">
<controlstyle width=175 borderwidth=1 borderstyle="inset" />
</asp:imagefield>
</fields>
</asp:detailsview>
<asp:accessdatasource id="designers" runat="server"
datafile="~/app_data/plans.mdb"
selectcommand="SELECT DISTINCT Design FROM Plans"
datasourcemode="DataReader" />
<asp:accessdatasource id="plans" runat="server"
datafile="~/app_data/plans.mdb"
selectcommand="SELECT * FROM Plans"
filterexpression="Design='{0}'">
<filterparameters>
<asp:controlparameter controlid="planDesign" propertyname="SelectedValue" />
</filterparameters>
</asp:accessdatasource>
</form>
</div>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>