943,981 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 1335
  • ASP.NET RSS
Oct 1st, 2007
0

ASP.NET project help

Expand Post »
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,
Similar Threads
Reputation Points: 11
Solved Threads: 1
Junior Poster in Training
justapimp is offline Offline
87 posts
since Sep 2007
Oct 1st, 2007
0

Re: ASP.NET project help

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.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Oct 1st, 2007
0

Re: ASP.NET project help

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.
Reputation Points: 11
Solved Threads: 1
Junior Poster in Training
justapimp is offline Offline
87 posts
since Sep 2007
Oct 1st, 2007
0

Re: ASP.NET project help

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.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Oct 1st, 2007
0

Re: ASP.NET project help

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.
Reputation Points: 11
Solved Threads: 1
Junior Poster in Training
justapimp is offline Offline
87 posts
since Sep 2007
Oct 1st, 2007
0

Re: ASP.NET project help

No problem. Do you best to make sure they disconnect from the popular browswers (IE, FireFox, Netscape, Opera, and Safari). Wish I could be more help.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Oct 1st, 2007
0

Re: ASP.NET project help

I think most browsers still execute the page unload event when you close them. You can always try it and see how it goes
Reputation Points: 683
Solved Threads: 53
Posting Virtuoso
Infarction is offline Offline
1,580 posts
since May 2006
Oct 1st, 2007
0

Re: ASP.NET project help

Click to Expand / Collapse  Quote originally posted by Infarction ...
I think most browsers still execute the page unload event when you close them. You can always try it and see how it goes
Actually, IE responds better to "onBeforeLoad", though it is not an option for other browsers
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: asp:Menu Images Disappearing
Next Thread in ASP.NET Forum Timeline: Implementing biometrics GrFinger in vb.net





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC