Hi, i was trying to use timer in asp.net. The purpose is like this, there will be a server(ASP.NET) and a client(Web Application).

I was trying to implement a timer in the client so that, for a specified period of time say 10 seconds, a function has to be called in the server side.

I used the below approach for this.

System.Threading.Timer objtimer = new System.Threading.Timer(new TimerCallback(this.samplefunction), "", 0, 3000);

"samplefunction" user defined function for calling a sample text box.

but i don't know how to implement it in asp.net. so that i can call a function/method for a specific interval of time.

The main scenario is that i am trying to develop a server, in that server if i subscribe a value, that value will be returned from the server for a user defined time interval.

Kindly help me regarding this issue.
Thanks in advance.

Recommended Answers

All 2 Replies

I don't think there is a way to do this using standard asp.net controls. You need to use client side javascript or ajax approach.

Thank you for your quick reply.. i will try with ajax.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.