•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,519 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,806 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 825 | Replies: 7
![]() |
•
•
Join Date: Sep 2007
Posts: 81
Reputation:
Rep Power: 2
Solved Threads: 1
I have this web page that sends a start real-time tracking command to GPS devices all over. The way the code is currently written fulfills its purpose as long as the page is actively loaded. However, if the user shuts down the browser or the computer, the device does not receive the stop real-time tracking command since the program is not running.
What I would like to accomplish is to create a script or service that will keep track of when a device needs to stop reporting in the event the user forgot to stop the real time tracking. I want to implement this feature for two reasons. First, the constant (non-stop) reporting becomes a billing issue for the company and second the devices are battery operated and the issue of energy consumption plays a big part.
What I was thinking on doing is implementing an AJAX script that will access the web method at the end of a specific interval but I believe this implementation will not work either. I tried to use the setTimeout() method with Ajax and it did not go very well.
I need some help and I would appreciate any input that would put me back on track with this project?
Thank you,
What I would like to accomplish is to create a script or service that will keep track of when a device needs to stop reporting in the event the user forgot to stop the real time tracking. I want to implement this feature for two reasons. First, the constant (non-stop) reporting becomes a billing issue for the company and second the devices are battery operated and the issue of energy consumption plays a big part.
What I was thinking on doing is implementing an AJAX script that will access the web method at the end of a specific interval but I believe this implementation will not work either. I tried to use the setTimeout() method with Ajax and it did not go very well.
I need some help and I would appreciate any input that would put me back on track with this project?
Thank you,
•
•
Join Date: Sep 2007
Posts: 1,058
Reputation:
Rep Power: 4
Solved Threads: 61
Have you considered using an Page_Unload method, and then backing it up through javascript on the <body onUnload="stopDevice()"> where stopDevice() is a javascript function?
This way you can have your C# or VB.NET to end your device transmission and a javascript backup just for insurance.
I have never dealt with the situation you are in, so I cannot be very good help, but hopefully I can lead you into a better direction.
This way you can have your C# or VB.NET to end your device transmission and a javascript backup just for insurance.
I have never dealt with the situation you are in, so I cannot be very good help, but hopefully I can lead you into a better direction.
•
•
Join Date: Sep 2007
Posts: 81
Reputation:
Rep Power: 2
Solved Threads: 1
Thank you for your reply and you definitely gave me some good idea on how to proceed. The question is: would this method also works if the user terminate the session by just closing the browser? I am really new to this javascript stuff but it doesn't appear to be a very difficult language. My real problem is that I don't know enough of it to be able to get things done fast enough.
•
•
Join Date: Sep 2007
Posts: 1,058
Reputation:
Rep Power: 4
Solved Threads: 61
Sure, here's a detailed explanation of what you can use, and what you might have to:
http://www.codeproject.com/useritems...of_Browser.asp
The one problem you will face is that javascript is client based, so if they have it disabled it will not work for them. You MIGHT be able to run the javascript server side since you're using asp.net, but I cannot guarantee that. You can use what you see here for an explanation on what to look for if you plan to write your own private function via VB or C#, or the like. I, personally, like to make sure all sides are covered. I would use the javascript, all functions for all browsers with if statements to determine which browser is which, and use the behind coding to make sure the connection is closed. I don't find a problem adding the extra code as it is only extra insurance, which I believe is necessary.
http://www.codeproject.com/useritems...of_Browser.asp
The one problem you will face is that javascript is client based, so if they have it disabled it will not work for them. You MIGHT be able to run the javascript server side since you're using asp.net, but I cannot guarantee that. You can use what you see here for an explanation on what to look for if you plan to write your own private function via VB or C#, or the like. I, personally, like to make sure all sides are covered. I would use the javascript, all functions for all browsers with if statements to determine which browser is which, and use the behind coding to make sure the connection is closed. I don't find a problem adding the extra code as it is only extra insurance, which I believe is necessary.
•
•
Join Date: Sep 2007
Posts: 81
Reputation:
Rep Power: 2
Solved Threads: 1
thank you for the link, though I understand some of the code on that page, but most of goes right over my head. For now I think it is safe to program a quick disconnect method in the event a user exited the page in question. later, I can take my time implementing a method that will cover all bases.
Thank you very much for your help.
Thank you very much for your help.
•
•
Join Date: May 2006
Location: Bellevue, WA
Posts: 1,548
Reputation:
Rep Power: 8
Solved Threads: 51
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net .net framework 3.0 access accounting software selection ajax asp business software code combo core custom data developer development dom dropdownlist erp systems evaluation evaluations fedora feed legacy linux microsoft module msdn net office project project management reader reuse selection skin software software selection software solutions sql technology evaluation theme vista weather web windows workflow xml xoap
- how can I copy asp.net project from one system and work on it in a different system (ASP.NET)
- i ned asp.net project (ASP.NET)
- I need a ASP.net project (ASP.NET)
- ASP.NET project (ASP.NET)
- Error creating new ASP.Net project (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Difference between asp & asp.net
- Next Thread: Implementing biometrics GrFinger in vb.net



Linear Mode