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

📄 editcourse.aspx

📁 一个多用户在线题库管理系统,可以实现各类试题的添加和管理
💻 ASPX
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EditCourse.aspx.cs" Inherits="Manager_EditCourse"  MasterPageFile="~/TQMS_Master.master"%>

<asp:Content ID="EditCourse" ContentPlaceHolderID="main" runat="server">
    <table height="100%" width="100%">
        <tr>
            <td width="5">
            </td>
            <td colspan="2">
                &nbsp;<asp:FormView ID="FormView1" runat="server" DataKeyNames="TQ_CourseID" DataSourceID="SqlDataSource1"
        DefaultMode="Edit" Width="319px">
        <EditItemTemplate>
            <table cellpadding="0" cellspacing="0" class="table" width="300">
                <tr>
                    <td class="tdHead" colspan="2">
                        <p class="MsoNormal">
                            <span>课程信息修改</span></p>
                    </td>
                </tr>
                <tr>
                    <td style="width: 100px" height="25">
                        &nbsp;课程编号:</td>
                    <td style="width: 100px" height="25">
                        <asp:Label ID="TQ_CourseIDLabel1" runat="server" Font-Bold="True" ForeColor="Red"
                            Text='<%# Eval("TQ_CourseID") %>'></asp:Label></td>
                </tr>
                <tr>
                    <td style="width: 100px" class="tdAlter">
                        课程名称:</td>
                    <td style="width: 100px" class="tdAlter">
                        <asp:TextBox ID="TQ_CourseNameTextBox" runat="server" Text='<%# Bind("TQ_CourseName") %>'></asp:TextBox></td>
                </tr>
                <tr>
                    <td colspan="2" height="5">
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                Text="更新"></asp:LinkButton>&nbsp;&nbsp; &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="取消"></asp:LinkButton>&nbsp;&nbsp;&nbsp;
                        &nbsp;<asp:HyperLink ID="hlkBack" runat="server" NavigateUrl="~/MCourse.aspx">返回</asp:HyperLink></td>
                </tr>
            </table>
            &nbsp; &nbsp;&nbsp;
        </EditItemTemplate>
        <InsertItemTemplate>
            <br />
            <table>
                <tr>
                    <td style="width: 100px">
                        课程编号:</td>
                    <td style="width: 100px">
                        <asp:Label ID="Label1" runat="server" Text="由系统自动生成"></asp:Label></td>
                </tr>
                <tr>
                    <td style="width: 100px">
                        课程名称:</td>
                    <td style="width: 100px">
                        <asp:TextBox ID="TQ_CourseNameTextBox" runat="server" Text='<%# Bind("TQ_CourseName") %>'></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="width: 100px">
                    </td>
                    <td style="width: 100px">
                    </td>
                </tr>
            </table>
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                Text="插入"></asp:LinkButton>
            <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="取消"></asp:LinkButton>
        </InsertItemTemplate>
        <ItemTemplate>
            <br />
            <table width="300">
                <tr>
                    <td style="width: 100px">
                        课程编号:</td>
                    <td align="left">
                        <asp:Label ID="TQ_CourseIDLabel" runat="server" Text='<%# Eval("TQ_CourseID") %>'></asp:Label></td>
                </tr>
                <tr>
                    <td style="width: 100px">
                        课程名称:</td>
                    <td align="left">
                        <asp:Label ID="TQ_CourseNameLabel" runat="server" Text='<%# Bind("TQ_CourseName") %>'></asp:Label></td>
                </tr>
                <tr>
                    <td style="width: 100px">
                    </td>
                    <td align="left">
                    </td>
                </tr>
            </table>
            <br />
        </ItemTemplate>
    </asp:FormView>
            </td>
        </tr>
    </table>
    &nbsp;&nbsp;
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:QuestionManagerConnectionString %>"
        SelectCommand="SELECT [TQ_CourseID], [TQ_CourseName] FROM [TQ_Courses] WHERE ([TQ_CourseID] = @TQ_CourseID)" 
        DeleteCommand="DELETE FROM [TQ_Courses] WHERE [TQ_CourseID] = @TQ_CourseID" 
        InsertCommand="INSERT INTO [TQ_Courses] ([TQ_CourseName]) VALUES (@TQ_CourseName)"
        UpdateCommand="UPDATE [TQ_Courses] SET [TQ_CourseName] = @TQ_CourseName WHERE [TQ_CourseID] = @TQ_CourseID">
        <SelectParameters>
            <asp:QueryStringParameter Name="TQ_CourseID" QueryStringField="id" Type="Int32" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="TQ_CourseID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="TQ_CourseName" Type="String" />
            <asp:Parameter Name="TQ_CourseID" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="TQ_CourseName" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>

</asp:Content>

⌨️ 快捷键说明

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