Click here to Skip to main content
15,888,062 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,
i want to display a stop watch in my web page,i have a page that display a question and four options, like this i have questions, for solving those question we have a time constriant that student has to finish his exam within the time, so for that i want to display a timer on the page that timer should display remaining time in mm:ss format.

Thanks in Advance.......


XML
It is displaying error like "DDateStampLabel does not exist in context"
Help me to solve this error...

<pre lang="xml">&lt;asp:ScriptManager ID=&quot;ScriptManager1&quot; runat=&quot;server&quot; /&gt;
        &lt;asp:Timer runat=&quot;server&quot; ID=&quot;UpdateTimer&quot; Interval=&quot;5000&quot; OnTick=&quot;UpdateTimer_Tick&quot; /&gt;
        &lt;asp:UpdatePanel runat=&quot;server&quot; ID=&quot;TimedPanel&quot; UpdateMode=&quot;Conditional&quot;&gt;
            &lt;Triggers&gt;
                &lt;asp:AsyncPostBackTrigger ControlID=&quot;UpdateTimer&quot; EventName=&quot;Tick&quot; /&gt;
            &lt;/Triggers&gt;
            &lt;ContentTemplate&gt;
                &lt;asp:Label runat=&quot;server&quot; ID=&quot;DateStampLabel&quot; /&gt;
            &lt;/ContentTemplate&gt;
        &lt;/asp:UpdatePanel&gt;</pre>


Code Behind File:

 DateStampLabel.Text = DateTime.Now.Tostring()
Posted
Updated 19-Jan-12 23:28pm
v3

Hi
you can use javascript stop watch

JavaScript Stopwatch[^]

Hope this will help :)

Thanks
Vinod Satapara
 
Share this answer
 
It is displaying error like "DDateStampLabel does not exist in context"
Help me to solve this error...

XML
<asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:Timer runat="server" ID="UpdateTimer" Interval="5000" OnTick="UpdateTimer_Tick" />
        <asp:UpdatePanel runat="server" ID="TimedPanel" UpdateMode="Conditional">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="UpdateTimer" EventName="Tick" />
            </Triggers>
            <ContentTemplate>
                <asp:Label runat="server" ID="DateStampLabel" />
            </ContentTemplate>
        </asp:UpdatePanel>



Code Behind File:

DateStampLabel.Text = DateTime.Now.Tostring()
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900