473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ASP (not .NET) server-side timer

My goal:
I need to cause my web application to check for updates on a remote website twice a week around a certain time. The routine would download the xml content of a given page, parse it, and retrieve information for use on my website. So I need to trigger the routine which does this on a scheduled interval.
It seems to me I need a timer that is initiated from the global.asa. I really don't care if it runs every 5 minutes or so (that's not a lot of server load) and checks the time, and if the day of the week and time are appropriate, the routine should get triggered and the remote website can be checked for the updated information I need.
I have seen "system.time" available for the .NET folks, but I'm trying to steer clear of .NET for a zillion reasons. Suffice it to say I'm using the old ASP and intend to keep it that way. Any ideas how I can accomplish what I need?
Thanks all.
Dec 19 '07 #1
12 3282
shweta123
692 Expert 512MB
Hi,

You can use setTimeout function to set the timer.
Syntax for doing this is :
ID = window.setTimeout("yourRoutine" , 5000)
This function will execute your subroutine after specified no of milliseconds.
To clear the timer if you do not want to execute the subroutine you can call
window.clearTimeout ID

My goal:
I need to cause my web application to check for updates on a remote website twice a week around a certain time. The routine would download the xml content of a given page, parse it, and retrieve information for use on my website. So I need to trigger the routine which does this on a scheduled interval.
It seems to me I need a timer that is initiated from the global.asa. I really don't care if it runs every 5 minutes or so (that's not a lot of server load) and checks the time, and if the day of the week and time are appropriate, the routine should get triggered and the remote website can be checked for the updated information I need.
I have seen "system.time" available for the .NET folks, but I'm trying to steer clear of .NET for a zillion reasons. Suffice it to say I'm using the old ASP and intend to keep it that way. Any ideas how I can accomplish what I need?
Thanks all.
Dec 20 '07 #2
Hi,

You can use setTimeout function to set the timer.
Syntax for doing this is :
ID = window.setTimeout("yourRoutine" , 5000)
This function will execute your subroutine after specified no of milliseconds.
To clear the timer if you do not want to execute the subroutine you can call
window.clearTimeout ID
window.setTimeout? That's a function to be used on a webpage with a window, right? How does that help me in an Application function? I can't use something like that in global.asa I don't believe. Am I wrong about that? I don't think I would run a routine like I described in my initial posting using something like this because nobody would be opening a window; it needs to be run automatically by the website application.
Dec 21 '07 #3
jhardman
3,406 Expert 2GB
Unfortunately, classic ASP only runs when pages are being loaded, so there is no way to set application timers. The best solution in ASP is for every page load, check whether it is the first load after a given time. If so, perform your task and reset the timer, otherwise continue.

Let me know if this helps.

Jared
Dec 21 '07 #4
Unfortunately, classic ASP only runs when pages are being loaded, so there is no way to set application timers. The best solution in ASP is for every page load, check whether it is the first load after a given time. If so, perform your task and reset the timer, otherwise continue.

Let me know if this helps.

Jared
Thanks for your effort, Jared. To be honest...no, it really doesn't help. The updates need to occur whether someone has visited the site or not, and cannot be reliant upon being triggered by a visitor. I had considered writing a program for a separate computer to simply visit the site on a regular basis to trigger just such a function, but then the site is again reliant upon outside sources in order to function, which will never do. I guess I'll just have to put the thinking cap back on.

For the record, I apologize for not responding sooner to your responses. I'm used to sites sending email notification when someone responds to a thread, and I'd been a bit preoccupied to think to check here sooner without a reminder. Thanks for your input.
Dec 23 '07 #5
shweta123
692 Expert 512MB
Hi,

You can use some third party activex control or the easy way is to create your own activex control using VB where you can have the facility to set the timer interval and it will fire the events at the time interval set. You will be able to trigger your routine in this interval. You can do this in Global.asax also.
I can help you in its coding if you want.
Dec 24 '07 #6
Hi,

You can use some third party activex control or the easy way is to create your own activex control using VB where you can have the facility to set the timer interval and it will fire the events at the time interval set. You will be able to trigger your routine in this interval. You can do this in Global.asax also.
I can help you in its coding if you want.
Hi Shweta,

Well that sure sounds like what I'd need. I admit that I wouldn't know how to do it. I am somewhat proficient in VB6, but creating an activeX is a bit more than I've ever tried. I'd certainly love some coaching in it. Umm...Global.asax refers to .NET, doesn't it?

Thanks for sticking with me on this. I'm feeling more pressure every day to come up with a solution.

StuckOnWords
Dec 26 '07 #7
jhardman
3,406 Expert 2GB
... Umm...Global.asax refers to .NET, doesn't it?
the "classic" ASP equivalent is called "global.asa"
Dec 30 '07 #8
the "classic" ASP equivalent is called "global.asa"
Right. I guess I was just wanting to ensure that whatever Shweta had in mind would be able to be implemented in classic asp as well as the .net versions.
Jan 2 '08 #9
peh803
1
Can you just write a vbscript task and schedule it to run in windows task manager? I have used this technique in many legacy MS environments to automate processes..

HTH,
Phil
Jan 2 '08 #10
I'm guessing you mean Windows Task Scheduler? The thing is, my site is hosted by an outside sourse. I don't have the option of setting up a scheduled item within the server operating system.
Jan 5 '08 #11
ilearneditonline
130 Expert 100+
I'm guessing you mean Windows Task Scheduler? The thing is, my site is hosted by an outside sourse. I don't have the option of setting up a scheduled item within the server operating system.
Alot of hosting providers allow you to set up cron jobs. Are you positive yours does not allow it??
Jan 5 '08 #12
Alot of hosting providers allow you to set up cron jobs. Are you positive yours does not allow it??
It never even occurred to me to ask them. I'll look into it. Thanks.
Jan 7 '08 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: tshad | last post by:
I have a W2003 server running my website and I am trying to set up my pages to send email using System.Web.Mail. I have pages running on this machine using CDONTS that work fine. I am using...
22
by: EP | last post by:
When running my asp.net hosting service (asp.net without IIS), on server 2003 with IIS not installed, I get the following when trying to process a request. "System.DllNotFoundException: Unable to...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
10
by: Mark A. Sam | last post by:
Hello, I am using Visual Web Developer and decared a Public Variable in the Class section. I assigned a value in the load section, and on a button I set it up to increment, but it always...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
39
by: dancer | last post by:
Can somebody tell me why I get this message with the following code? Compiler Error Message: BC30452: Operator '&' is not defined for types 'String' and 'System.Web.UI.WebControls.TextBox'. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.