i have to start timer on .cshtml view page of my mvc application the way asp timer starts on page_load of asp.net application .for this i want to use controller action method and i am desparate to do it using wcf service <pre lang="xml"><asp:UpdatePanel ID="up" UpdateMode="Conditional" runat="server"> <Triggers> <asp:AsyncPostBackTrigger ControlID="tm" EventName="Tick" /></Triggers> <ContentTemplate> <div style="position:absolute; top: 265px; left: 600px; height: 20px; width:150px; " id="col" runat="server"> <asp:Label ID="lbtime" Font-Bold="true" Width="100" ForeColor="White" runat="server" ></asp:Label></div> <asp:Label ID="lbtime0" runat="server" Font-Bold="true" ForeColor="Black" ></asp:Label> </ContentTemplate> </asp:UpdatePanel></pre> in code behind <pre lang="cs">protected void Timer_Tick(object sender, EventArgs e) {</pre> // lbtime.Visible = true; if (sender == tm) { string s = Convert.ToString(Request.Cookies["Contest"].Value); sqlread = dclass.GetRead("select * from CEntry where ContestTitle='" + Request.Cookies["Contest"].Value + "'"); if (sqlread.Read()) { DateTime startDate = System.DateTime.Now; DateTime timetoexpirecontest = Convert.ToDateTime(sqlread["Duration"]); TimeSpan t = timetoexpirecontest - startDate; // TimeSpan t2 = new TimeSpan(11,0,0); // t = t.Add(t2); if (t.Days <= 0 && t.Hours <= 0 && t.Minutes <= 0 && t.Seconds <= 0) { //countdown action //disable button } } } } i want to achieve timer tick event means above mention thing in mvc 's controller action method and that too using wcf service that's why tell me every thing means where to set timer ,how to coutdown it dynamically using database in mvc 3.0 razor
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)