<%@ Page Language="C#" AutoEventWireup="true" %>
<!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>DataPager Fields ButtonCssClass - how to use ButtonCssClass in DataPager</title>
<style type="text/css">
.TableCSS
{
background-color:HotPink;
width: 675px;
}
.TableHeader
{
background-color:DeepPink;
color:Snow;
font-size:large;
font-family:Times New Roman;
height:40px;
}
.TableData
{
background-color:HotPink;
color:Snow;
font-family:Courier New;
font-size:medium;
font-weight:bold;
height:28px;
}
.ItemSeparatorCSS
{
background-color:Pink;
height:2px;
}
.TablePager
{
background-color:Salmon;
height:45px;
}
.ButtonCSS
{
color:OrangeRed;
height:35px;
font-weight:bold;
}
.NumericButtonCSS
{
font-size:x-large;
font-family:Courier New;
color:White;
font-weight:bold;
}
.CurrentPageLabelCSS
{
font-size:xx-large;
font-family:Courier New;
color:DarkRed;
font-weight:bold;
}
.NextPreviousButtonCSS
{
font-size:large;
font-family:Courier New;
color:White;
font-weight:bold;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:Navy; font-style:italic;">DataPager Control Example: How To Use ButtonCssClass</h2>
<hr width="575" align="left" color="PowderBlue" />
<asp:SqlDataSource
ID="SqlDataSource1"
runat="server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="Select ProductID, ProductName, UnitPrice From products Order By ProductID"
>
</asp:SqlDataSource>
<br />
<asp:ListView
ID="ListView1"
runat="server"
DataSourceID="SqlDataSource1"
>
<LayoutTemplate>
<table id="Table1" runat="server" class="TableCSS">
<tr id="Tr1" runat="server" class="TableHeader">
<td id="Td1" runat="server">Product ID</td>
<td id="Td2" runat="server">Product Name</td>
<td id="Td3" runat="server">Unit Price</td>
</tr>
<tr id="ItemPlaceholder" runat="server">
</tr>
<tr id="Tr2" runat="server" class="TablePager">
<td id="Td4" runat="server" colspan="3">
<asp:DataPager ID="DataPager1" runat="server">
<Fields>
<asp:NextPreviousPagerField
ButtonType="Button"
ShowFirstPageButton="true"
ShowNextPageButton="true"
ShowPreviousPageButton="false"
ButtonCssClass="ButtonCSS"
/>
<asp:NumericPagerField
NumericButtonCssClass="NumericButtonCSS"
CurrentPageLabelCssClass="CurrentPageLabelCSS"
NextPreviousButtonCssClass="NextPreviousButtonCSS"
/>
<asp:NextPreviousPagerField
ButtonType="Button"
ShowLastPageButton="true"
ShowNextPageButton="false"
ButtonCssClass="ButtonCSS"
/>
</Fields>
</asp:DataPager>
</td>
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr class="TableData">
<td>
<asp:Label
ID="Label1"
runat="server"
Text='<%# Eval("ProductID")%>'
>
</asp:Label>
</td>
<td>
<asp:Label
ID="Label2"
runat="server"
Text='<%# Eval("ProductName")%>'
>
</asp:Label>
</td>
<td>
<asp:Label
ID="Label3"
runat="server"
Text='<%# Eval("UnitPrice")%>'
>
</asp:Label>
</td>
</tr>
</ItemTemplate>
<ItemSeparatorTemplate>
<tr>
<td colspan="3" class="ItemSeparatorCSS"></td>
</tr>
</ItemSeparatorTemplate>
</asp:ListView>
</div>
</form>
</body>
</html>
No comments:
Post a Comment