📄 buttonfieldformat.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ButtonFieldFormat.aspx.cs" Inherits="ButtonFieldFormat" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>未命名页面</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td style="width: 200px">
<asp:GridView ID="gviewProduct" runat="server" BackColor="White" BorderColor="#E7E7FF"
BorderStyle="None" BorderWidth="1px" CellPadding="3" DataSourceID="SqlDataSource1"
OnRowCommand="gviewProduct_RowCommand" AutoGenerateColumns="False" Font-Size="10pt">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<Columns>
<asp:BoundField DataField="ProductID" HeaderText="ProductID" InsertVisible="False"
ReadOnly="True" SortExpression="ProductID" />
<asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" />
<asp:BoundField DataField="UnitPrice" HeaderText="UnitPrice" SortExpression="UnitPrice" />
<asp:ButtonField ButtonType="Button" CommandName="Order" Text="订购" DataTextField="ProductName" DataTextFormatString="订购:{0}" >
<ControlStyle BackColor="#FFC0C0" Width="200px" />
<ItemStyle BackColor="White" />
</asp:ButtonField>
<asp:ButtonField ButtonType="Button" CommandName="CancelOrder" Text="取消" DataTextField="ProductName" DataTextFormatString="取消:{0}" >
<ControlStyle BackColor="#C0C0FF" Width="200px" />
</asp:ButtonField>
</Columns>
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<AlternatingRowStyle BackColor="#F7F7F7" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [ProductID], [ProductName], [UnitPrice] FROM [Products]"></asp:SqlDataSource>
</td>
<td style="width: 100px" valign="top">
<asp:Label ID="txtOrder" runat="server" Text="您订购的产品如下:" Width="189px"></asp:Label>
<asp:ListBox ID="lbOrder" runat="server" Height="200px" Width="200px"></asp:ListBox></td>
</tr>
</table>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -