Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
1.80/5 (3 votes)
See more:
$.ajax({
type: "POST",
url: "BackGroundService/DispatcherTimerSetup",
data: { lati: lati, longi: longi },
async: true,
cache: false,
datatype: "html",

[HttpPost]
public void DispatcherTimerSetup(HttpClient httpClient, string lati, string longi, string UserId)
{
dispatcherTimer = new DispatcherTimer();
dispatcherTimer.Tick += dispatcherTimer_Tick;
dispatcherTimer.Interval = new TimeSpan(0, 0, 2);
if (!dispatcherTimer.IsEnabled)
{
dispatcherTimer.Start();
}
}
async void dispatcherTimer_Tick(object sender, object e)
{
//Some functionality
}

I tried Dispacher But it's not working means Break Point not hitting dispatcherTimer_Tick(object sender, object e) this method So I decided to do with Normal Timer it self can any one give me any Examples please
Posted

1 solution

Why are you using a Timer in the server side of a web app? It doesn't make any sense since the web server can never call the client. What use is it?

What exactly do you mean by "background process"?? What is this process supposed to do?
 
Share this answer
 
v2

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