📄 sellerinfo.aspx
字号:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="SellerInfo.aspx.cs" Inherits="SellerInfo" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div align="center">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="#DEBA84"
BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2"
DataKeyNames="SellerID" DataSourceID="SqlDataSource1" Style="position: relative" AllowPaging="True" OnRowDeleting="GridView1_RowDeleting">
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<Columns>
<asp:BoundField DataField="SellerID" HeaderText="SellerID" InsertVisible="False"
ReadOnly="True" SortExpression="SellerID" />
<asp:BoundField DataField="SellerName" HeaderText="SellerName" SortExpression="SellerName" />
<asp:BoundField DataField="SellerPassword" HeaderText="SellerPassword" SortExpression="SellerPassword" />
<asp:BoundField DataField="SellerDep" HeaderText="SellerDep" SortExpression="SellerDep" />
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update"
Text="Update"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel"
Text="Cancel"></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit"
Text="Edit" OnClientClick="return confirm('确定要修改吗?');"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Delete"
Text="Delete" OnClientClick="return confirm('确定要删除吗?');"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
</asp:GridView>
<asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False"
DataKeyNames="SellerID" DataSourceID="SqlDataSource1" Height="50px" Style="position: relative"
Width="125px">
<Fields>
<asp:BoundField DataField="SellerID" HeaderText="SellerID" InsertVisible="False"
ReadOnly="True" SortExpression="SellerID" />
<asp:BoundField DataField="SellerName" HeaderText="SellerName" SortExpression="SellerName" />
<asp:BoundField DataField="SellerPassword" HeaderText="SellerPassword" SortExpression="SellerPassword" />
<asp:BoundField DataField="SellerDep" HeaderText="SellerDep" SortExpression="SellerDep" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [Seller] WHERE [SellerID] = @original_SellerID"
InsertCommand="INSERT INTO [Seller] ([SellerName], [SellerPassword], [SellerDep]) VALUES (@SellerName, @SellerPassword, @SellerDep)"
OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [Seller]"
UpdateCommand="UPDATE [Seller] SET [SellerName] = @SellerName, [SellerPassword] = @SellerPassword, [SellerDep] = @SellerDep WHERE [SellerID] = @original_SellerID AND [SellerName] = @original_SellerName AND [SellerPassword] = @original_SellerPassword AND [SellerDep] = @original_SellerDep">
<DeleteParameters>
<asp:Parameter Name="original_SellerID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="SellerName" Type="String" />
<asp:Parameter Name="SellerPassword" Type="String" />
<asp:Parameter Name="SellerDep" Type="String" />
<asp:Parameter Name="original_SellerID" Type="Int32" />
<asp:Parameter Name="original_SellerName" Type="String" />
<asp:Parameter Name="original_SellerPassword" Type="String" />
<asp:Parameter Name="original_SellerDep" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="SellerName" Type="String" />
<asp:Parameter Name="SellerPassword" Type="String" />
<asp:Parameter Name="SellerDep" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</div>
</asp:Content>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -