📄 questions.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="questions.aspx.cs" Inherits="questions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>考试问题</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<table width="560" align="center">
<tr>
<td width="100%" align="right">
<asp:LoginName ID="LoginName1" runat="server" CssClass="boldtext" FormatString="当前的用户: {0}" />
</td>
</tr>
</table>
<table width="560" align="center">
<tr>
<td style="height: 35px" class="h1">
开始考试</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td class="h1">
当前用户:
<asp:Label ID="currentTestLabel" runat="server"></asp:Label></td>
</tr>
<tr>
<td>
<asp:DetailsView ID="questionDetails" runat="server" Height="50px" Width="550px"
AutoGenerateRows="False" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" CssClass="generaltext" />
<FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" CssClass="boldtext" Width="80px" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<Fields>
<asp:BoundField DataField="Title" HeaderText="问题:" SortExpression="Title" />
<asp:BoundField DataField="Answer1" HeaderText="选项 1:" SortExpression="Answer1" />
<asp:BoundField DataField="Answer2" HeaderText="选项 2:" SortExpression="Answer2" />
<asp:BoundField DataField="Answer3" HeaderText="选项 3:" SortExpression="Answer3" />
<asp:BoundField DataField="Answer4" HeaderText="选项 4:" SortExpression="Answer4" />
</Fields>
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#999999" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" CssClass="generaltext" />
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [QuestionID], [Title], [Answer1], [Answer2], [Answer3], [Answer4], [CorrectAnswer], [QuestionOrder] FROM [Question] WHERE ([QuizID] = @QuizID) ORDER BY [QuestionOrder]">
<SelectParameters>
<asp:SessionParameter SessionField="QuizID" Type="Int32" Name="QuizID" DefaultValue="0" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td class="boldtext">
请选择:
<asp:DropDownList ID="answerDropDownList" runat="server">
<asp:ListItem Value="1">选项 1</asp:ListItem>
<asp:ListItem Value="2">选项 2</asp:ListItem>
<asp:ListItem Value="3">选项 3</asp:ListItem>
<asp:ListItem Value="4">选项 4</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td align="right">
<asp:Button ID="nextButton" runat="server" OnClick="nextButton_Click" Text="下一题" />
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -