You must Sign In to post a response.
  • Category: ASP.NET

    Online Examination With Proper CountDown and Generating Report

    Hi,
    Can you please send me your project with source code on my email ID :naresh.tech09@gmail.com
  • #592725
    You can create a Count Down Timer using the following code:

    Design
    ------


    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick" Interval="1000" Enabled="true">
    </asp:Timer>
    <asp:Label ID="LblTimeLeft1" runat="server" Text="Time Left: "></asp:Label>
    <asp:Label ID="LblTime1" runat="server"></asp:Label>
    <asp:Timer ID="Timer2" runat="server" OnTick="Timer1_Tick" Interval="1000" Enabled="true">
    </asp:Timer>
    <asp:Label ID="LblTimeLeft2" runat="server" Text="Time Left: "></asp:Label>
    <asp:Label ID="LblTime2" runat="server"></asp:Label>
    </ContentTemplate>

    </asp:UpdatePanel>
    </div>


    C# Code Behind
    --------------


    protected void Page_Load(object sender, EventArgs e)
    {
    if (Session["StartTime"] == null)
    Session["StartTime"] = DateTime.Now;
    }
    protected void Timer1_Tick(object sender, EventArgs e)
    {
    DateTime FutureTime1;
    TimeSpan RemainingTime1;
    FutureTime1 = Convert.ToDateTime("2010-Nov-18 12:12:00");
    RemainingTime1 = FutureTime1.Subtract(DateTime.Now);
    LblTime1.Text = RemainingTime1.Days.ToString() + ":" +RemainingTime1.Hours.ToString() + ":" + RemainingTime1.Minutes.ToString() + ":" + RemainingTime1.Seconds.ToString();
    if (DateTime.Now >= FutureTime1)
    {
    LblTime1.Text = "Time Over";
    Timer1.Enabled = false;
    }

    DateTime FutureTime2;
    TimeSpan RemainingTime2;
    FutureTime2 = Convert.ToDateTime("2010-Nov-19 01:00:00");
    RemainingTime2 = FutureTime2.Subtract(DateTime.Now);
    LblTime2.Text = RemainingTime2.Days.ToString() + ":" + RemainingTime2.Hours.ToString() + ":" + RemainingTime2.Minutes.ToString() + ":" + RemainingTime2.Seconds.ToString();
    if (DateTime.Now >= FutureTime2)
    {
    LblTime2.Text = "Time Over";
    Timer2.Enabled = false;
    }
    }


    Thanks & Regards
    Paritosh Mohapatra
    Microsoft MVP (ASP.Net/IIS)
    DotNetSpider MVM

  • #597555
    hi. can you send me this project code on my email id manoj_kumar9991@yahoo.com


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.