📄 datalist.aspx
字号:
<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="DataList.aspx.vb" Inherits="DataList" %>
<!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>
<form id="frmDefault" runat="server">
<div>
<table id="tblMain" bgcolor="gainsboro" border="0" cellpadding="0" cellspacing="0"
style="width: 100%; height: 100%">
<tr>
<td style="height: 30px; width: 760px;">
<strong><span style="font-family: Arial"> Test Web Site for ADO.NET 2.0 Data Sources
and Bound Controls
<asp:DropDownList ID="ddlCountries" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
DataSourceID="dsCountries" DataTextField="ShipCountry" DataValueField="ShipCountry"
Width="108px">
<asp:ListItem>[Select a Country]</asp:ListItem>
</asp:DropDownList><asp:SqlDataSource ID="dsCountries" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT DISTINCT [ShipCountry] FROM [Orders] ORDER BY [ShipCountry]">
</asp:SqlDataSource>
</span></strong></td>
</tr>
<tr>
<td style="height: 450px; width: 760px;" valign="top">
<span style="font-family: Arial">
<asp:DataList ID="dlOrders" runat="server" DataKeyField="OrderID" DataSourceID="dsOrders" Font-Names="Verdana" Font-Size="10pt" RepeatColumns="2" RepeatDirection="Horizontal" Width="742px">
<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><br />
<br />
</ItemTemplate>
</asp:DataList><asp:SqlDataSource ID="dsOrders" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [OrderID], [CustomerID], [EmployeeID], [OrderDate], [RequiredDate], [ShippedDate], [ShipVia], [Freight], [ShipName] FROM [Orders] WHERE (([ShipCountry] = @ShipCountry) AND ([OrderID] <= @OrderID)) ORDER BY [OrderID] DESC">
<SelectParameters>
<asp:ControlParameter ControlID="ddlCountries" DefaultValue="USA" Name="ShipCountry"
PropertyName="SelectedValue" Type="String" />
<asp:Parameter DefaultValue="11077" Name="OrderID" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</span></td>
</tr>
</table>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -