📄 16.4.txt
字号:
Listing 16.4 Creating DataList Commands
<asp:DataList id=”DataList1” runat=”server” BorderColor=”#999999”
BorderStyle=”None” BackColor=”White” CellPadding=”3” GridLines=”Vertical”
BorderWidth=”1px” DataSource=”<%# productsDS1 %>” DataKeyField=”ProductID”
DataMember=”Products” Width=”648px” CellSpacing=”5”>
<!-- DataList Styles -->
<ItemStyle ForeColor=”Black” BackColor=”#EEEEEE”></ItemStyle>
<SelectedItemStyle Font-Bold=”True” ForeColor=”White” BackColor=”#CCCCFF”/>
<AlternatingItemStyle BackColor=”Gainsboro”></AlternatingItemStyle>
<SeparatorStyle BorderStyle=”Solid”></SeparatorStyle>
<FooterStyle ForeColor=”Black” BackColor=”#CCCCCC”></FooterStyle>
<HeaderStyle Font-Bold=”True” HorizontalAlign=”Center” ForeColor=”White”
BackColor=”#000084”></HeaderStyle>
<!-- DataList Templates -->
<HeaderTemplate>Products</HeaderTemplate>
<SelectedItemTemplate>
<P><FONT color=”#000000”>
<%# DataBinder.Eval(Container.DataItem, “ProductName”) %>
<asp:LinkButton id=”btnRename” Runat=”server”
CommandName=”edit” Text=”Rename”/>
<BR>
ID: <%# DataBinder.Eval(Container.DataItem, “UnitPrice”) %> <BR>
Price: <%# DataBinder.Eval(Container.DataItem, “UnitPrice”) %> <BR>
</FONT></P>
</SelectedItemTemplate>
<ItemTemplate>
<asp:LinkButton id=LinkButton1 Runat=”server” CommandName=”select”
Text=’<%# DataBinder.Eval(Container.DataItem, “ProductName”) %>’/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id=”tbRename” runat=”server” Width=”294px”
Text=’<%# DataBinder.Eval(Container.DataItem, “ProductName”) %>’/>
<asp:LinkButton id=”btnUpdate” Runat=”server” CommandName=”update”
Text=”Update”></asp:LinkButton><BR>
</EditItemTemplate>
</asp:DataList>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -