AdorableVB
AdorableVB

Reputation: 1393

How to properly use start and stop timer on ASP.net?

I am having problems on using a timer on ASP.Net I am unable to start the timer after stopping it.

I am calling the functions from code behind using

ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyFun1", "startTimer();", true);

Gives me this error. Screenshot below..

enter image description here

My main problem is that I need to used the timer like this.. Do something > Start time > Do something on Tick + Stop time > Do something > Start time But I can't because I cannot restart the timer when I stopped it.

<asp:Timer ID="tmrMain" runat="server" Interval="1000" EnableViewState="False"></asp:Timer>

Upvotes: 0

Views: 641

Answers (1)

D-Shih
D-Shih

Reputation: 46219

Because $ is Jquery Object, find is method.

So you might use dot to call method

$.find('tmrMain');

Upvotes: 1

Related Questions