📄 product.aspx
字号:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="product.aspx.cs" Inherits="product" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
CellPadding="3" DataSourceID="SqlDataSource1" GridLines="Vertical" OnRowCommand="GridView1_RowCommand"
Width="293px">
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<Columns>
<asp:BoundField DataField="productid" HeaderText="商品编号" InsertVisible="False" SortExpression="productid" />
<asp:BoundField DataField="productname" HeaderText="产品名称" SortExpression="productname" />
<asp:BoundField DataField="quantiyperunit" HeaderText="单位数量" SortExpression="quantiyperunit" />
<asp:BoundField DataField="unitprice" HeaderText="单价" SortExpression="unitprice" />
<asp:ButtonField ButtonType="Button" CommandName="Select" HeaderText="选择" ShowHeader="True"
Text="购买" />
</Columns>
<RowStyle BackColor="#EEEEEE" ForeColor="Black" />
<SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#DCDCDC" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:shoppingConnectionString %>"
SelectCommand="SELECT [productid], [productname], [categoryid], [quantiyperunit], [unitprice] FROM [product] WHERE ([categoryid] = @categoryid)">
<SelectParameters>
<asp:QueryStringParameter Name="categoryid" QueryStringField="cid" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</asp:Content>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -