⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fanclubmatchreport.aspx

📁 ASP.NET2.0(C#篇)经典教程的源码...本源码很好的实现了购物车....编码规范和类的设计具有很好的借鉴性!
💻 ASPX
字号:
<%@ Page Language="C#" MasterPageFile="~/site.master" AutoEventWireup="true" codefile="FanClubMatchReport.aspx.cs" Inherits="FanClubMatchReport" %>
<%@ Register TagPrefix="wu" TagName="FixtureList" Src="../FixtureList.ascx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" Runat="server">
    
    <wu:FixtureList ID="FixtureList1" Runat="server" />
    
    <br />

    <asp:sqldatasource id="SqlDataSource1" runat="server"
        selectcommand="SELECT [ReportID], [FixtureID], [Report], [MemberName] FROM [MatchReports] WHERE ([FixtureID] = @FixtureID) AND MemberName=@MemberName"
        DeleteCommand="DELETE FROM [MatchReports] WHERE [ReportID] = @ReportID"
        InsertCommand="INSERT INTO [MatchReports] ([FixtureID], [Report], [MemberName]) VALUES (@FixtureID, @Report, @MemberName)"
        UpdateCommand="UPDATE [MatchReports] SET [Report] = @Report WHERE [ReportID] = @ReportID"
        connectionstring="<%$ ConnectionStrings:WroxUnited %>"
        OnInserted="SqlDataSource1_Inserted"
        OnUpdated="SqlDataSource1_Updated">
        <DeleteParameters>
            <asp:Parameter Type="Int32" Name="ReportID"></asp:Parameter>
        </DeleteParameters>
        <UpdateParameters>
            <asp:ControlParameter Name="FixtureID" Type="Int32" ControlID="FixtureList1" PropertyName="SelectedValue"></asp:ControlParameter>
            <asp:Parameter Type="String" Name="Report"></asp:Parameter>
            <asp:Parameter Type="Int32" Name="ReportID"></asp:Parameter>
            <asp:ProfileParameter Type="string" Name="MemberName" PropertyName="MemberName"></asp:ProfileParameter>
        </UpdateParameters>
        <SelectParameters>
            <asp:ProfileParameter Type="string" Name="MemberName" PropertyName="UserName"></asp:ProfileParameter>
            <asp:ControlParameter Name="FixtureID" Type="Int32" ControlID="FixtureList1" PropertyName="SelectedValue"></asp:ControlParameter>
        </SelectParameters>
        <InsertParameters>
            <asp:ControlParameter Name="FixtureID" Type="Int32" ControlID="FixtureList1" PropertyName="SelectedValue"></asp:ControlParameter>
            <asp:Parameter Type="String" Name="Report"></asp:Parameter>
            <asp:ProfileParameter Type="string" Name="MemberName" PropertyName="UserName"></asp:ProfileParameter>
        </InsertParameters>
    </asp:sqldatasource>

    <asp:formview id="FormView1" runat="server" datasourceid="SqlDataSource1"
        datakeynames="ReportID" AllowPaging="true">
        <PagerSettings Mode="NextPreviousFirstLast"
            FirstPageImageUrl="~/Images/arrow_first.gif" FirstPageText="First report"
            LastPageImageUrl="~/Images/arrow_last.gif"  LastPageText="Last report"
            NextPageImageUrl="~/Images/arrow_next.gif" NextPageText="Next report"
            PreviousPageImageUrl="~/Images/arrow_prev.gif" PreviousPageText="Previous report" />
        <EmptyDataTemplate>
            <asp:LinkButton ID="AddReport" runat="server" Text="Add Report" OnClick="AddReport_Click" />
        </EmptyDataTemplate>
        <FooterTemplate>
        </FooterTemplate>
        <EditItemTemplate>
            <asp:TextBox id="TextBox1" runat="server" Text='<%# Bind("Report") %>' Rows="10" Columns="75" TextMode="MultiLine"></asp:TextBox> 
            <br />
            <asp:RequiredFieldValidator ID="rfv1" runat="server"
                ControlToValidate="TextBox1"
                Text="You haven't entered the report!" />
            <br />
            <asp:linkbutton id="btnUpdateReport" runat="server" CommandName="Update" Text="Save Changes" />
            <asp:linkbutton id="btnCancelReport" runat="server" CommandName="Cancel" Text="Cancel Changes" CausesValidation="false" />
            <p />
        </EditItemTemplate>
        <InsertItemTemplate>
            <asp:TextBox id="TextBox1" runat="server" Text='<%# Bind("Report") %>' Rows="10" Columns="75" TextMode="MultiLine"></asp:TextBox> 
            <br />
            <asp:RequiredFieldValidator ID="rfv1" runat="server"
                ControlToValidate="TextBox1"
                Text="You haven't entered the report!" />
            <br />
            <asp:linkbutton id="btnNewReport1" runat="server" CommandName="Insert" Text="Save New Report" />
            <asp:linkbutton id="btnCancelReport" runat="server" CommandName="Cancel" Text="Cancel New Report" CausesValidation="false" />
        </InsertItemTemplate>
        <ItemTemplate>
            <asp:Label Text='<%# Bind("Report") %>' runat="server" id="ReportLabel" /><br />
            <asp:linkbutton id="btnEditReport" runat="server" CommandName="Edit" Text="Edit Report" />
            <asp:linkbutton id="btnNewReport" runat="server" CommandName="New" Text="Add New Report" />
        </ItemTemplate>   
    </asp:formview>
  
</asp:Content>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -