Validation ASP.Net Tutorial

<%@ Page Language="C#" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    void Page_Load()
    {
        if (!Page.IsPostBack)
            ResetStartTime();
    }
    void btnAgain_Click(Object sender, EventArgs e)
    {
        ResetStartTime();
    }
    void ResetStartTime()
    {
        Session["StartTime"] = DateTime.Now;
    }
    void valAnswer_ServerValidate(Object source, ServerValidateEventArgs args)
    {
        DateTime startTime = (DateTime)Session["StartTime"];
        if (startTime.AddSeconds(5) > DateTime.Now)
            args.IsValid = true;
        else
            args.IsValid = false;
    }



    Timed Test


    
    

            id="lblQuestion"
        Text="What was Aristotle's first name?"
        AssociatedControlID="txtAnswer"
        Runat="server" />
    
            id="txtAnswer"
        Runat="server" />
            id="valAnswer"
        Text="(You answered too slowly!)"
        OnServerValidate="valAnswer_ServerValidate"
        Runat="server" />
    
            id="btnSubmit"
        Text="Submit"
        Runat="server" />
            id="btnAgain"
        Text="Try Again!"
        CausesValidation="false"
        OnClick="btnAgain_Click"
        Runat="server" />