ASP.NET DetailsView Fields, BoundField, PagerSettings and PagerStyle

asp.net DetailsView Fields, BoundField, PagerSettings, PagerStyle example
DetailsViewPagingExample.aspx
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>asp.net DetailsView Fields, BoundField, PagerSettings, PagerStyle example</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Red">DetailsView BoundField, Paging Example</h2>
        <asp:SqlDataSource
             ID="SqlDataSource1"
             runat="server"
             ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
             SelectCommand="SELECT TOP 5 EmployeeID, LastName, FirstName, City FROM Employees"
             >
        </asp:SqlDataSource>
        <asp:DetailsView
             ID="DetailsView1" 
             runat="server"
             DataSourceID="SqlDataSource1"
             AutoGenerateRows="false"
             BackColor="Azure"
             ForeColor="SeaGreen"
             BorderColor="Sienna"
             AllowPaging="true"
             >
             <Fields>
                <asp:BoundField HeaderText="Employee ID" DataField="EmployeeID" />
                <asp:BoundField HeaderText="First Name" DataField="FirstName" />
                <asp:BoundField HeaderText="Last Name" DataField="LastName" />
                <asp:BoundField HeaderText="City" DataField="City" />
            </Fields>
            <PagerSettings Mode="NextPreviousFirstLast" FirstPageText="First" LastPageText="Last" NextPageText="Next" PreviousPageText="Previous" />
            <PagerStyle BackColor="AliceBlue" ForeColor="HotPink" />
        </asp:DetailsView>
    </div>
    </form>
</body>
</html>






Related asp.net example