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

📄 elect.aspx

📁 基于asp.net的网上选课系统
💻 ASPX
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Elect.aspx.cs" Inherits="Elect" %>

<%@ Register Src="../pg.ascx" TagName="pg" TagPrefix="uc1" %>
<!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 bgcolor="inactivecaptiontext" scroll="auto" background="../img/x200662817362436940.jpg">
    <form id="form1" runat="server">
    <div style="text-align: center">
        <span style="font-family: 隶书">
            课程名称</span>:<asp:TextBox ID="txtCourseName" runat="server" ></asp:TextBox>
        &nbsp; <span style="font-family: 隶书">
      老师姓名:</span><asp:TextBox ID="txtTeacherName" runat="server" ></asp:TextBox>
       <asp:Button ID="btSearch" runat="server" OnClick="Button1_Click" Text="查询" Font-Names="隶书" Font-Size="Medium" Height="28px" Width="57px" />
    <asp:DataList ID="DataList1" runat="server"  DataKeyField="CourseID"  Font-Bold="False" Font-Italic="False" Font-Names="隶书" Font-Overline="False" Font-Strikeout="False" Font-Underline="False"  HorizontalAlign="Center"  OnItemCommand="DataList1_ItemCommand" Height="223px" Width="633px">
           <HeaderTemplate>
            <table>
            <tr>
          <td>课程号</td><td> 课程名称</td><td>课时</td><td>学分</td><td>教师号</td><td>教师姓名</td><td>可选人数上限</td><td>已选人数</td><td>选择</td>
          </tr>
          </HeaderTemplate>
            <ItemTemplate>
            <tr>
               <td><asp:Label ID="CourseIDLabel" runat="server" Text='<%# Eval("CourseID") %>'></asp:Label></td>
                <td><asp:Label ID="CourseNameLabel" runat="server" Text='<%# Eval("CourseName") %>'>
                </asp:Label></td>
                <td><asp:Label ID="CourseHoursLabel" runat="server" Text='<%# Eval("CourseHours") %>'>
                </asp:Label></td>
                <td><asp:Label ID="CourseScoreLabel" runat="server" Text='<%# Eval("CourseScore") %>'>
                </asp:Label></td>
                <td><asp:Label ID="TeacherIDLabel" runat="server" Text='<%# Eval("TeacherID") %>'></asp:Label></td>
                <td><asp:Label ID="TeacherNameLabel" runat="server" Text='<%# Eval("TeacherName") %>'></asp:Label></td>
                <td><asp:Label ID="UpperLimitStudentNumberLabel" runat="server" Text='<%# Eval("UpperLimitStudentNumber") %>'>
                </asp:Label></td>
                <td><asp:Label ID="SelectedStudentNumberLabel" runat="server" Text='<%# Eval("SelectedStudentNumber") %>'>
                </asp:Label></td>
                <td><asp:LinkButton ID="btelect" runat="server" Text="选定" commandname="electcourse"/></td>
             </tr>
            </ItemTemplate>
            <SeparatorTemplate>
            <tr>
            <td colspan="9">
            <hr size="1pt" color="blue" />
            </td>
            </tr>
            </SeparatorTemplate>
            <FooterTemplate>
            </FooterTemplate>            
            <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                Font-Underline="False" HorizontalAlign="Center" VerticalAlign="Middle" />
            <EditItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                Font-Underline="False" HorizontalAlign="Center" VerticalAlign="Middle" />
            <SelectedItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                Font-Underline="False" HorizontalAlign="Center" VerticalAlign="Middle" />
            <AlternatingItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" VerticalAlign="Middle" />
            <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                Font-Underline="False" HorizontalAlign="Center" VerticalAlign="Middle" />
            <SeparatorStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                Font-Underline="False" />
            <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                Font-Underline="False" HorizontalAlign="Center" VerticalAlign="Middle" />
        </asp:DataList><br />
        <uc1:pg ID="Pg1" runat="server" />
        <br />
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;
        &nbsp;&nbsp;<br />
        <asp:DataList ID="DataList2" runat="server" DataSourceID="SqlDataSource2"
            Font-Bold="False" Font-Italic="False" Font-Names="隶书" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"  OnItemCommand="DataList2_ItemCommand" CaptionAlign="Top" DataKeyField="CourseID" RepeatDirection="Horizontal" Height="330px" Width="574px"  >
          <HeaderTemplate>
          <table>
          <tr>
          <td>你已经选修的课程如下所示:</td>
          </tr>
          <tr>
          <td>课程号</td><td>课程名称</td><td>教师号</td><td>教师姓名</td><td>课时</td><td>学分</td><td>退选</td>
          </tr>
          </HeaderTemplate>
            <ItemTemplate>
             <tr>
              <td><asp:Label ID="CourseIDLabel" runat="server" Text='<%# Eval("CourseID") %>'></asp:Label></td> 
              <td><asp:Label ID="CourseNameLabel" runat="server" Text='<%# Eval("CourseName") %>'>
                </asp:Label></td>
               <td> <asp:Label ID="TeacherIDLabel" runat="server" Text='<%# Eval("TeacherID") %>'></asp:Label></td>
               <td><asp:Label ID="TeacherNameLabel" runat="server" Text='<%# Eval("TeacherName") %>'>
                </asp:Label></td>
               <td> <asp:Label ID="CourseScoreLabel" runat="server" Text='<%# Eval("CourseScore") %>'>
                </asp:Label></td>
                <td><asp:Label ID="CourseHoursLabel" runat="server" Text='<%# Eval("CourseHours") %>'>
                </asp:Label></td>
                <td><asp:LinkButton ID="btdelete" runat="server" Text="退选" commandname="deletecourse"/></td>
               </tr>
           </ItemTemplate>
            <SeparatorTemplate>
            <tr>
            <td colspan="7">
            <hr size="1pt" color="blue" />
            </td>
            </tr>
            </SeparatorTemplate>
            <FooterTemplate>
            </table>
            </FooterTemplate>            
            <FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <EditItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                Font-Underline="False" HorizontalAlign="Center" VerticalAlign="Middle" />
            <SelectedItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <AlternatingItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
            <SeparatorStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                Font-Underline="False" />
            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="False" />
        </asp:DataList>
        &nbsp;<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:courseConn %>"
            SelectCommand="ElectiveList" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter Name="StudentID" SessionField="userid"
                    Type="String" DefaultValue="" />
            </SelectParameters>
        </asp:SqlDataSource>
        &nbsp;&nbsp;
    
    </div>
    </form>
</body>
</html>

⌨️ 快捷键说明

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