Login.asp Tutorial X
<%@ page language= "C #" autoeventwireup= "true" codefile= "Login.aspx.cs" inherits= "Login"%>
<!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> User Login Page </title>
<link href= "CSS tutorial/onlineexam.css" rel= "stylesheet" type= "Text/css"/>
</head>
<body>
<form id= "Form1" runat= "Server" >
<div class= "Login-panel" >
<div id= "errormessage" class= "Errors_div" style= "Display:none"; >
</div>
<div style= "WIDTH:104PX; height:26px;margin:10px Auto "><b> Online exam system </b></div>
<p class= "Top Clearfix" >
<label for= "Course" >
Exam Subjects:</label>
<asp:dropdownlist id= "DropDownList1" runat= "Server" >
</asp:dropdownlist>
</p>
<p class= "Top Clearfix" >
<label for= "Email" >
Account:</label>
<input type= "text" name= "email" class= "input-text" id= "Email" tabindex= "1" value= "" runat= "Server"
Style= "Color:rgb (136, 136, 136);" />
<asp:requiredfieldvalidator id= "Requiredfieldvalidator1"
runat= "Server" errormessage= "RequiredFieldValidator" text= "cannot be empty" display= "dynamic" controltovalidate= "email" > </asp:requiredfieldvalidator>
</p>
<p class= "Clearfix" >
<label for= "Password" >
Password:</label>
<input type= "password" id= "password" name= "password" error= "Please enter password" class= "Input-text" runat= "Server"
tabindex= "2" >
<asp:requiredfieldvalidator id= "Requiredfieldvalidator2" runat= "Server" errormessage= "RequiredFieldValidator" Text= "cannot be empty" controltovalidate= "password" display= "dynamic" ></asp:requiredfieldvalidator>
</p>
<div class= "Caps tutorials-lock-tips" id= "Capslockmessage" style= "Display:none" >
</div>
<p class= "Bottom" >
<input type= "button" id= "Login" class= "input-submit" value= "Login" tabindex= "4" runat= "Server" onserverclick= " Loginclick ">
</p>
<div class= "RegNow" >
<input type= "button" id= "RegNow" class= "Input-button" value= "Register Now" tabindex= "4" stats= "Home_quickreg" >
</div>
</div>
</form>
</body>
</html>
Usertext.aspx
<%@ page language= "C #" autoeventwireup= "true" codefile= "Usertest.aspx.cs" inherits= "Usertest"%>
<!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> Online Exam Page </title>
</head>
<body>
<form id= "Form1" runat= "Server" >
<div style= "Text-align:center;" ><%=papername%></div>
<div>
<asp:gridview id= "GridView1" runat= "Server" width= "100%"
Autogeneratecolumns= "false" >
<columns>
<asp:templatefield>
<headertemplate>
<asp:label id= "Label5" runat= "Server" text= "one, single choice question (Each question" ></asp:label>
<asp:label id= "label6" runat= "Server" text= "label" ></asp:label>
<asp:label id= "LABEL7" runat= "server" text= "cent" ></asp:label>
</headertemplate>
<itemtemplate>
<table style= "width:100%;" >
<tr>
<TD colspan= ' 3 ' >
<asp:label id= "Label1" runat= "server" text= ' <%# container.dataitemindex+1%> ' ></asp:label>
<asp:label id= "Label2" runat= "server" text= ' <% #eval ("title")%> ' ></asp:label>
<asp:label id= "label3" runat= "server" text= ' <% #eval ("answer")%> ' visible= ' false ' ></asp:label>
<asp:label id= "Label4" runat= "text= ' <% #eval (" Mark ")%> ' visible= ' false ></asp:label>
</td>
</tr>
<tr>
<TD style= "width:35%;" >
A:<asp:radiobutton id= "RadioButton1" runat= "server" text= ' <% #eval ("a")%> ' groupname= ' s1 '/>
</td>
<TD style= "width:35%;" >
B:<asp:radiobutton id= "RadioButton2" runat= "server" text= ' <% #eval ("b")%> ' groupname= ' s1 '/>
</td>
</tr>
<tr>
<TD style= "width:35%;" >
C:<asp:radiobutton id= "RadioButton3" runat= "text= ' <% #eval (" C ")%> ' groupname= ' s1 '/>
</td>
<TD style= "width:35%;" >
D:<asp:radiobutton id= "RadioButton4" runat= "server" text= ' <% #eval ("D")%> ' groupname= ' s1 '/>
</td>
</tr>
</table>
</itemtemplate>
</asp:templatefield>
</columns>
<headerstyle horizontalalign= "left"/>
</asp:gridview>
<asp:gridview id= "GridView2" runat= "Server" width= "100%"
Autogeneratecolumns= "false" >
<columns>
<asp:templatefield>
<headertemplate>
<asp:label id= "label12" runat= "Server" text= "two multiple-choice questions (each" ></asp:label>
<asp:label id= "Label13" runat= "Server" text= "label" ></asp:label>
<asp:label id= "Label14" runat= "server" text= "cent" ></asp:label>
</headertemplate>
<itemtemplate>
<table style= "width:100%;" >
<tr>
<TD colspan= ' 3 ' >
<asp:label id= "Label8" runat= "server" text= ' <%# container.dataitemindex+1%> ' ></asp:label>
<asp:label id= "Label9" runat= "server" text= ' <% #eval ("title")%> ' ></asp:label>
<asp:label id= "Label10" runat= "server" text= ' <% #eval ("answer")%> ' visible= ' false ' ></asp:label>
<asp:label id= "Label11" runat= "text= ' <% #eval (" Mark ")%> ' visible= ' false ></asp:label>
</td>
</tr>
<tr>
<TD style= "width:35%;" >
A:<asp:checkbox id= "CheckBox1" runat= "server" text= ' <% #eval ("a")%> '/>
</td>
<TD style= "width:35%;" >
B:<asp:checkbox id= "CheckBox2" runat= "server" text= ' <% #eval ("b")%> '/>
</td>
</tr>
<tr>
<TD style= "width:35%;" >
C:<asp:checkbox id= "Checkbox3" runat= "server" text= ' <% #eval ("C")%> '/>
</td>
<TD style= "width:35%;" >
D:<asp:checkbox id= "checkbox4" runat= "server" text= ' <% #eval ("D")%> '/>
</td>
</tr>
</table>
</itemtemplate>
</asp:templatefield>
</columns>
<headerstyle horizontalalign= "left"/>
</asp:gridview>
<asp:gridview id= "GRIDVIEW3" runat= "Server" width= "100%"
Autogeneratecolumns= "false" >
<columns>
<asp:templatefield>
<headertemplate>
<asp:label id= "label19" runat= "Server" text= "three, the judgment question (each question" ></asp:label>
<asp:label id= "LABEL20" runat= "Server" text= "label" ></asp:label>
<asp:label id= "label21" runat= "server" text= "cent" ></asp:label>
</headertemplate>
<itemtemplate>
<table style= "width:100%;" >
<tr>
<TD colspan= ' 3 ' >
<asp:label id= "label15" runat= "server" text= ' <%# container.dataitemindex+1%> ' ></asp:label>
<asp:label id= "Label16" runat= "server" text= ' <% #eval ("title")%> ' ></asp:label>
<asp:label id= "LABEL17" runat= "server" text= ' <% #eval ("answer")%> ' visible= ' false ' ></asp:label>
<asp:label id= "label18" runat= "text= ' <% #eval (" Mark ")%> ' visible= ' false ></asp:label>
</td>
</tr>
<tr>
<TD style= "width:35%;" >
<asp:radiobutton id= "radiobutton5" runat= "server" text= "correct"/>
</td>
<TD style= "width:35%;" >
<asp:radiobutton id= "Radiobutton6" runat= "Server" text= "error"/>
</td>
</tr>
</table>
</itemtemplate>
</asp:templatefield>
</columns>
<headerstyle horizontalalign= "left"/>
</asp:gridview>
<asp:gridview id= "GRIDVIEW4" runat= "Server" width= "100%"
Autogeneratecolumns= "false" >
<columns>
<asp:templatefield>
<headertemplate>
<asp:label id= "label28" runat= "Server" text= "four, fill in the blanks question (each question" ></asp:label>
<asp:label id= "label29" runat= "Server" text= "label" ></asp:label>
<asp:label id= "label30" runat= "server" text= "cent" ></asp:label>
</headertemplate>
<itemtemplate>
<table style= "width:100%;" >
<tr>
<TD colspan= ' 3 ' >
<asp:label id= "label24" runat= "server" text= ' <%# container.dataitemindex+1%> ' ></asp:label>
<asp:label id= "Label26" runat= "server" text= ' <% #eval ("answer")%> ' visible= ' false ' ></asp:label>
<asp:label id= "label27" runat= "text= ' <% #eval (" Mark ")%> ' visible= ' false ></asp:label>
</td>
</tr>
<tr>
<TD style= "width:35%;" >
<asp:label id= "label22" runat= "server" text= ' <% #eval ("Fronttitle")%> ' ></asp:label>
<asp:textbox id= "TextBox1" runat= "Server" ></asp:textbox>
<asp:label id= "label23" runat= "server" text= ' <% #eval ("Backtitle")%> ' ></asp:label>
</td>
</tr>
</table>
</itemtemplate>
</asp:templatefield>
</columns>
<headerstyle horizontalalign= "left"/>
</asp:gridview>
<asp:button id= "button1" runat= "server" text= "handing in"
Onclientclick= ' return confirm ("Sure to do it?") ' onclick= ' button1_click '/>
</div>
</form>
</body>
</html>
Web.config
<?xml version= "1.0"?>
<!--
Note: In addition to manually editing this file, you can also use the
Web Administration tool to configure settings for your application. Can be used in Visual Studio
The Web site-> the asp.net tutorial configuration option.
The complete list of settings and comments is
Machine.config.comments, this file is typically located in the
In Windowsmicrosoft.netframeworkv2.xconfig
-->
<configuration>
<configsections>
<sectiongroup name= "system.web.extensions" type= "System.web.configuration.systemwebextensionssectiongroup, System.Web.Extensions, version=3.5.0.0, culture=neutral, publickeytoken=31bf3856ad364e35 ">
<sectiongroup name= "scripting" type= "System.web.configuration.scriptingsectiongroup, System.Web.Extensions, version=3.5.0.0, Culture=neutral, publickeytoken=31bf3856ad364e35 ">
<section name= "scriptResourceHandler" type= "system.web.configuration.scriptingscriptresourcehandlersection, System.Web.Extensions, version=3.5.0.0, Culture=neutral, publickeytoken=31bf3856ad364e35 "requirepermission=" false "allowdefinition=" MachineToApplication "/>
<sectiongroup name= "webservices" type= "System.web.configuration.scriptingwebservicessectiongroup, System.Web.Extensions, version=3.5.0.0, culture=neutral, publickeytoken=31bf3856ad364e35 ">
<section name= "jsonserialization" type= "system.web.configuration.scriptingjsonserializationsection, System.Web.Extensions, version=3.5.0.0, Culture=neutral, publickeytoken=31bf3856ad364e35 "requirepermission=" false "allowdefinition=" Everywhere "/>
<section name= "ProfileService" type= "system.web.configuration.scriptingprofileservicesection, System.Web.Extensions, version=3.5.0.0, Culture=neutral, publickeytoken=31bf3856ad364e35 "requirepermission=" false "allowdefinition=" MachineToApplication "/>
<section name= "AuthenticationService" type= "system.web.configuration.scriptingauthenticationservicesection, System.Web.Extensions, version=3.5.0.0, Culture=neutral, publickeytoken=31bf3856ad364e35 "requirepermission=" false "allowdefinition=" MachineToApplication "/>
<section name= "RoleService" type= "System.web.configuration.scriptingroleservicesection, System.Web.Extensions, version=3.5.0.0, Culture=neutral, publickeytoken=31bf3856ad364e35 "requirepermission=" false "allowdefinition=" MachineToApplication "/>
</sectiongroup>
</sectiongroup>
</sectiongroup>
</configsections>
<appsettings/>
<connectionstrings>
<add name= "onlineexamconnectionstring" connectionstring= "Data source=.sqlexpress;attachdbfilename=| datadirectory|onlineexam.mdf;integrated security=true;user instance=true "providername=" System.Data.SqlClient " >
</connectionstrings>
<system.web>
<!--
Set compilation debug= "True" to insert debug symbols
Pages that have been compiled. But since this will
Affect performance, so this value is only in the development process
Set to True.
-->
<compilation debug= "true" >
<assemblies>
<add assembly= "System.core, version=3.5.0.0, culture=neutral, publickeytoken=b77a5c561934e089"/>
<add assembly= "system.web.extensions, version=3.5.0.0, culture=neutral, publickeytoken=31bf3856ad364e35"/>
<add assembly= "System.data.datasetextensions, version=3.5.0.0, Culture=neutral, publickeytoken=b77a5c561934e089 "/>
<add assembly= "System.Xml.Linq, version=3.5.0.0, culture=neutral, publickeytoken=b77a5c561934e089"/>
<add assembly= "System.Data.Linq, version=3.5.0.0, Culture=neutral, publickeytoken=b77a5c561934e089"/></ Assemblies>
</compilation>
<!--
Through the <authentication> section you can configure ASP.net to
Identify the user who entered the
Secure authentication mode.
-->
<authentication mode= "Windows"/>
<!--
If an unhandled error occurs during the execution of the request,
The <customerrors> section allows you to configure the appropriate processing steps. Specifically
The section enables developers to configure
HTML error page to display
In place of the error stack trace.
<customerrors mode= "RemoteOnly" defaultredirect= "genericerrorpage.htm" >
<error statuscode= "403" redirect= "noaccess.htm"/>
<error statuscode= "404" redirect= "filenotfound.htm"/>
</customerrors>
-->
<pages>
<controls>
<add tagprefix= "asp" namespace= "System.Web.UI" assembly=, System.Web.Extensions, version=3.5.0.0 , publickeytoken=31bf3856ad364e35 "/>
<add tagprefix= "asp" namespace= "System.Web.UI.WebControls" assembly=, System.Web.Extensions, Culture=neutral, publickeytoken=31bf3856ad364e35 "/>
</controls>
</pages>
<httphandlers>
<remove verb= "*" path= "*.asmx"/>
<add verb= "*" path= "*.asmx" validate= "false" Type= "System.web.script.services.scripthandlerfactory, System.Web.Extensions, version=3.5.0.0, culture=neutral, publickeytoken=31bf3856ad364e35 "/>
<add verb= "*" path= "*_appservice.axd" validate= "false" Type= "System.web.script.services.scripthandlerfactory, System.Web.Extensions, version=3.5.0.0, culture=neutral, publickeytoken=31bf3856ad364e35 "/>
<add verb= "Get,head" path= ScriptResource.axd "type=" System.web.handlers.scriptresourcehandler, System.Web.Extensions, version=3.5.0.0, Culture=neutral, publickeytoken=31bf3856ad364e35 "validate=" false "/>
</httphandlers>
<httpmodules>
<add name= "Scriptmodule" type= "System.web.handlers.scriptmodule, system.web.extensions, version=3.5.0.0, culture =neutral, publickeytoken=31bf3856ad364e35 "/>
</httpmodules>
</system.web>
<system.codedom>
<compilers>
<compiler language= "C#;cs;csharp" extension= "warninglevel=" 4 "type=" Microsoft.csharp.csharpcodeprovider, System, version=2.0.0.0, Culture=neutral, publickeytoken=b77a5c561934e089 ">
<provideroption name= "CompilerVersion" value= "v3.5"/>
<provideroption name= "WarnAsError" value= "false"/>
</compiler>
<compiler language= "Vb;vbs;visualbasic;vbscript" extension= ". vb" warninglevel= "4" type= " Microsoft.visualbasic.vbcodeprovider, System, version=2.0.0.0, Culture=neutral, publickeytoken=b77a5c561934e089 " >
<provideroption name= "CompilerVersion" value= "v3.5"/>
<provideroption name= "Optioninfer" value= "true"/>
<provideroption name= "WarnAsError" value= "false"/>
</compiler>
</compilers>
</system.codedom>
<!--
Running ASP.net ajax requires system.webserver under Internet Information Services 7.0
Section. This section is not required for earlier versions of IIS.
-->
<system.webserver>
<validation validateintegratedmodeconfiguration= "false"/>
<modules>
<remove name= "Scriptmodule"/>
<add name= "Scriptmodule" precondition= managedhandler "type=" System.web.handlers.scriptmodule, System.Web.Extensions, version=3.5.0.0, culture=neutral, publickeytoken=31bf3856ad364e35 "/>
</modules>
<handlers>
<remove name= "webservicehandlerfactory-integrated"/>
<remove name= "ScriptHandlerFactory"/>
<remove name= "Scripthandlerfactoryappservices"/>
<remove name= "ScriptResource"/>
<add name= "ScriptHandlerFactory" verb= "*" path= "*.asmx" "precondition=" Integratedmode "type=" System.web.script.services.scripthandlerfactory, System.Web.Extensions, version=3.5.0.0, Culture=neutral, Publickeytoken=31bf3856ad364e35 "/>
<add name= "scripthandlerfactoryappservices" verb= "*" path= "*_appservice.axd" precondition= "Integratedmode" type= "System.web.script.services.scripthandlerfactory, System.Web.Extensions, version=3.5.0.0, Culture=neutral, Publickeytoken=31bf3856ad364e35 "/>
<add name= "ScriptResource" precondition= "Integratedmode" verb= "Get,head" path= "ScriptResource.axd" System.web.handlers.scriptresourcehandler, System.Web.Extensions, version=3.5.0.0, Culture=neutral, PublicKeyToken =31bf3856ad364e35 "/>
</handlers>
</system.webserver>
<runtime>
<assemblybinding xmlns= "Urn:schemas-microsoft-com:asm.v1" >
<dependentassembly>
<assemblyidentity name= "system.web.extensions" publickeytoken= "31bf3856ad364e35"/>
<bindingredirect oldversion= "1.0.0.0-1.1.0.0" newversion= "3.5.0.0"/>
</dependentassembly>
<dependentassembly>
<assemblyidentity name= "system.web.extensions.design" publickeytoken= "31bf3856ad364e35"/>
<bindingredirect oldversion= "1.0.0.0-1.1.0.0" newversion= "3.5.0.0"/>
</dependentassembly>
</assemblybinding>
</runtime>
</configuration>