Click here to Skip to main content
15,894,825 members
Articles / Web Development / HTML

A Simple AJAX Quiz Using Atlas

Rate me:
Please Sign up or sign in to vote.
4.08/5 (11 votes)
1 Aug 2006CPOL3 min read 80.8K   1.4K   33  
A simple way to create a quiz using Atlas controls and Web Services.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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>Ajax Quiz sample</title>
</head>
<body>
    <form id="form1" runat="server">
        <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
            <Scripts>
                <atlas:ScriptReference Path="AjaxQuiz.js" />
            </Scripts>
            <Services>
                <atlas:ServiceReference Path="QuestionService.asmx" />
            </Services>
        </atlas:ScriptManager>
        <div id="StartForm">
            <input id="btnStart" type="button" value="Start the Ajax Quiz !" onclick="Callback()" />
        </div>
        <div id="QuizForm" style="display: none;">
            <div id="QuestionText"></div>
            <br />
            <input type="radio" id="YesAnswer" name="Answer" checked="checked" />&nbsp;Yes
            <input type="radio" id="NoAnswer" name="Answer" />&nbsp;No
            <input type="radio" id="DontKnowAnswer" name="Answer" />&nbsp;?<br /><br />
            <input id="btnCallBack" type="button" value="Next" onclick="Callback()" />&nbsp;
            <img id="imgUpdate" src="Images/spinner.gif" alt="Updating data" style="display: none;" />
            <input id="QuestionID" type="hidden" value="0" />
        </div>
        <div id="EndForm" style="display: none;">
            Thank you, this quiz is now finished !&nbsp;
        </div>
        <div id="divError"></div>
    </form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
France France
I'm currently working for a transportation company in France and am responsible for software projects.

Comments and Discussions