📄 finaldatalist.aspx
字号:
<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="FinalDataList.aspx.vb" Inherits="FinalDataList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.NET 2.0 Data Sources and Databound Controls Test Site</title>
</head>
<body bottommargin="10" topmargin="10">
<form id="frmMain" runat="server">
<div>
<table style="width: 100%; height: 100%" cellspacing="0" cellpadding="0" border="0" id="tblMain" bgcolor="gainsboro">
<tr>
<td style="height: 18px">
<span style="font-size: 14pt; font-family: Arial"><b> Test Web Site for Data Sources
and Controls <asp:DropDownList ID="ddlCountry" Runat="server" Height="22px"
Width="121px" DataSourceID="dsCountries" DataTextField="ShipCountry" DataValueField="ShipCountry"
AutoPostBack="True" Font-Size="10pt" Font-Names="Verdana">
</asp:DropDownList> <asp:DropDownList ID="ddlOrderID" Runat="server"
DataSourceID="dsOrders" DataTextField="OrderID" DataValueField="OrderID"
AutoPostBack="True" OnSelectedIndexChanged="ddlOrderID_SelectedIndexChanged" Font-Size="10pt" Font-Names="Verdana">
</asp:DropDownList>
<asp:TextBox ID="txtCustomerID" Runat="server" Height="16px" Width="56px" Font-Size="10pt" Font-Names="Verdana"></asp:TextBox>
<asp:SqlDataSource
ID="dsCountries" Runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT DISTINCT [ShipCountry] FROM [Orders] ORDER BY [ShipCountry]">
</asp:SqlDataSource></b></span></td>
</tr>
<tr>
<td>
<asp:DataList ID="dlOrders" Runat="server" DataKeyField="OrderID" DataSourceID="dsOrders"
BorderColor="#999999" BackColor="#EEEEEE" BorderWidth="1px" GridLines="Vertical"
BorderStyle="None" CellPadding="3" Font-Names="Verdana" Font-Size="10pt"
Width="100%" Height="50px" RepeatColumns="2" SelectedIndex="0" RepeatDirection="Horizontal" ShowFooter="False" ShowHeader="False">
<FooterStyle ForeColor="Black" BackColor="#CCCCCC"></FooterStyle>
<ItemTemplate>
OrderID:
<asp:Label ID="OrderIDLabel" Runat="server" Text='<%# Eval("OrderID") %>'></asp:Label>
CustomerID:
<asp:Label ID="CustomerIDLabel" Runat="server" Text='<%# Eval("CustomerID") %>'></asp:Label><br />
EmployeeID:
<asp:Label ID="EmployeeIDLabel" Runat="server" Text='<%# Eval("EmployeeID") %>'></asp:Label>
OrderDate:
<asp:Label ID="OrderDateLabel" Runat="server" Text='<%# Eval("OrderDate", "{0:d}") %>'></asp:Label><br />
RequiredDate:
<asp:Label ID="RequiredDateLabel" Runat="server" Text='<%# Eval("RequiredDate", "{0:d}") %>'></asp:Label>
ShippedDate:
<asp:Label ID="ShippedDateLabel" Runat="server" Text='<%# Eval("ShippedDate", "{0:d}") %>'></asp:Label><br />
ShipVia:
<asp:Label ID="ShipViaLabel" Runat="server" Text='<%# Eval("ShipVia") %>'></asp:Label>
Freight:
<asp:Label ID="FreightLabel" Runat="server" Text='<%# Eval("Freight", "{0:C}") %>'></asp:Label><br />
ShipName:
<asp:Label ID="ShipNameLabel" Runat="server" Text='<%# Eval("ShipName") %>'></asp:Label>
</ItemTemplate>
<ItemStyle ForeColor="Black" BackColor="#EEEEEE"></ItemStyle>
<SelectedItemStyle ForeColor="White" Font-Bold="True" BackColor="SteelBlue"></SelectedItemStyle>
<HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#000084"></HeaderStyle>
</asp:DataList>
<asp:SqlDataSource ID="dsOrders" Runat="server" SelectCommand="SELECT [OrderID], [CustomerID], [EmployeeID], [OrderDate], [RequiredDate], [ShippedDate], [ShipVia], [Freight], [ShipName] FROM [Orders] WHERE ([ShipCountry] = @ShipCountry) ORDER BY [OrderID] DESC"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>">
<SelectParameters>
<asp:ControlParameter Name="ShipCountry" DefaultValue="USA" Type="String" ControlID="ddlCountry"
PropertyName="SelectedValue"></asp:ControlParameter>
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -