473,388 Members | 1,256 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,388 software developers and data experts.

Auto Run ASP.NET pages



I want to auto run asp.net page after a fixed interval of time without
sending any request from browser to server. I dont want to use windows
service or something like that.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #1
5 2915
Khurram Hanif <kh********@yahoo.com> wrote in news:eKQqbM13EHA.3224
@TK2MSFTNGP10.phx.gbl:
I want to auto run asp.net page after a fixed interval of time without
sending any request from browser to server. I dont want to use windows
service or something like that.


AFAIK there isn't an easy way to launch a page or keep a site alive...

However, Paul Wilson does have an artice on how to extend the globalbase
class to reload the page automatically to keep an ASP.NET application
alive. You might be able to modify it for your purpose:

http://authors.aspalliance.com/PaulW...rticles/?id=12

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #2
Ha! I think I just answered you under another name on the
asp.net forums, but here's a copy in case you're someone else:

Not that *I* know of. Web (including asp.net) pages are
"dumb" and only respond to requests.

The first dirty solution that comes to mind is setting up a
small console app to run as a scheduled job...in it you
could use a HttpWebRequest object to invisibly fire a
request to the page so it would run.

However, that might be a cosmic waste of time when you
could have just placed the code you needed to run within
the console application, that's probably your best bet and
easiest solution.

I have no idea what your requirements are so I'm just
shooting in the dark here.

-v
-----Original Message-----
I want to auto run asp.net page after a fixed interval of time withoutsending any request from browser to server. I dont want to use windowsservice or something like that.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
.

Nov 19 '05 #3
Try using System.Timer inside of Application.Start in global.asax. It can
trigger a new thread in defined intervals. Maybe enough for you, but aware
that this would be running under aspnet working thread and corresponding
privildges.
"Khurram Hanif" <kh********@yahoo.com> píse v diskusním príspevku
news:eK**************@TK2MSFTNGP10.phx.gbl...


I want to auto run asp.net page after a fixed interval of time without
sending any request from browser to server. I dont want to use windows
service or something like that.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #4
I've made a test using the Timer Component and it work *almost* fine.

The code on the Enabled event is like this:
System.IO.TextWriter writer = new
System.IO.StreamWriter("d:/tmp/global_timer.log", true);
writer.WriteLine(String.Format("Log time: {0:F}", DateTime.Now));
writer.Flush();
writer.Close();

However the log is being appended twice.
Here's a chunk of the log:

App Started at Friday, January 21, 2005 12:55:56 AM
Log time: Friday, January 21, 2005 12:56:56 AM
Log time: Friday, January 21, 2005 12:56:56 AM
Log time: Friday, January 21, 2005 12:57:56 AM
Log time: Friday, January 21, 2005 12:57:56 AM
Log time: Friday, January 21, 2005 12:58:56 AM
Log time: Friday, January 21, 2005 12:58:56 AM
Log time: Friday, January 21, 2005 12:59:56 AM
Log time: Friday, January 21, 2005 12:59:56 AM
The first line is logged on the Application.Start method, with similar code.

Regards,
Manuel.

"Jiri Zidek" wrote:
Try using System.Timer inside of Application.Start in global.asax. It can
trigger a new thread in defined intervals. Maybe enough for you, but aware
that this would be running under aspnet working thread and corresponding
privildges.
"Khurram Hanif" <kh********@yahoo.com> pÃ*se v diskusnÃ*m prÃ*spevku
news:eK**************@TK2MSFTNGP10.phx.gbl...


I want to auto run asp.net page after a fixed interval of time without
sending any request from browser to server. I dont want to use windows
service or something like that.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 19 '05 #5
BTW, I modified a little bit the Elapsed code to write two lines instead, it
seams the Elapsed event is fire twice, take a look to the log:

App Started at Friday, January 21, 2005 1:18:20 AM
Log time: Friday, January 21, 2005 1:19:19 AM
EOL
Log time: Friday, January 21, 2005 1:19:20 AM
EOL
Log time: Friday, January 21, 2005 1:20:19 AM
EOL
Log time: Friday, January 21, 2005 1:20:20 AM
EOL
Log time: Friday, January 21, 2005 1:21:19 AM
EOL
Log time: Friday, January 21, 2005 1:21:20 AM
EOL
Notice the 1 sec diff! The interval, you might have guessed, is 60 secs.

Is this a bug or something?

Regards,
Manuel.
"Manuel Vázquez" <Manuel Vázq***@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
I've made a test using the Timer Component and it work *almost* fine.

The code on the Enabled event is like this:
System.IO.TextWriter writer = new
System.IO.StreamWriter("d:/tmp/global_timer.log", true);
writer.WriteLine(String.Format("Log time: {0:F}", DateTime.Now));
writer.Flush();
writer.Close();

However the log is being appended twice.
Here's a chunk of the log:

App Started at Friday, January 21, 2005 12:55:56 AM
Log time: Friday, January 21, 2005 12:56:56 AM
Log time: Friday, January 21, 2005 12:56:56 AM
Log time: Friday, January 21, 2005 12:57:56 AM
Log time: Friday, January 21, 2005 12:57:56 AM
Log time: Friday, January 21, 2005 12:58:56 AM
Log time: Friday, January 21, 2005 12:58:56 AM
Log time: Friday, January 21, 2005 12:59:56 AM
Log time: Friday, January 21, 2005 12:59:56 AM
The first line is logged on the Application.Start method, with similar
code.

Regards,
Manuel.

"Jiri Zidek" wrote:
Try using System.Timer inside of Application.Start in global.asax. It
can
trigger a new thread in defined intervals. Maybe enough for you, but
aware
that this would be running under aspnet working thread and corresponding
privildges.
"Khurram Hanif" <kh********@yahoo.com> píse v diskusním príspevku
news:eK**************@TK2MSFTNGP10.phx.gbl...
>
>
> I want to auto run asp.net page after a fixed interval of time without
> sending any request from browser to server. I dont want to use windows
> service or something like that.
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!


Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: hb | last post by:
Hi, The auto-formatting of HTML code in Visual Studio.Net 2003 is very annoying! I already unchecked the 2 checkboxes in "Apply Automatic Formatting" section located at: Tools-->Options-->Text...
4
by: Rick Csucsai | last post by:
After a year and a half of not touching ASP.NET, I have finally talked my company into letting me build a useable app in .NET instead of classic. Now I have to play catch up. i would really...
8
by: speralta | last post by:
I'm playing around with a test page that uses a <div id="main"within the context of a body with a width of 100% to center a fixed width field on a page. For some reason, the page is not centering...
3
by: John A Grandy | last post by:
Could someone explain exactly how RSS auto-discovery works ? Thanks.
1
by: daniellee2006 | last post by:
I am creating a basic website to store people profiles and within this website i have a page that creates a table dependent on the number of records in mysql written in PHP within these tables...
5
by: lazypig06 | last post by:
Hi ! I'd like to ask everyone this question. I am currently maintain a website which have hundreds of pages and lot of subdirectories. Most of these pages contains a common function (let's call...
2
by: des-sd | last post by:
Access Experts, Please help! I have looked through ref. manuals, Google Groups on "Auto Populate", and I am still lost. Problem #1 My DB is 2 relational tables of (1) sales transactions of,...
27
by: Harris Kosmidhs | last post by:
Hello. sorry if this has been answered previously. I use a main wrapper div to put the whole site in it. And I use margin: 0 auto 0 auto in order to center the page. But in IE it fails. Is...
0
chumlyumly
by: chumlyumly | last post by:
Hello scripters - OS: Mac OSX Language: PHP w/ MySQL database I've created an insert page where a user inputs his info, which then goes to four different tables in a MySQL database. The...
3
by: Iluvatar | last post by:
Hi, last week our project upgraded from vs.net 2005 to vs.net 2008. Our project still uses framework 2.0, because the deployment servers are not 3.x ready yet. Everything so far while migrating...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.