Session Start in Global.asa

C

Chris

I want to use the global.asa file to trigger tasks. Sessions get started
frequently enough to put some code in there to schedule tasks once a day
without resorting to vbs scripts etc which I can't get permission to run.
This works fine but does the code that gets triggered cause the person
starting the session to have to wait until it is finished. I was hoping it
started on another thread. Regards.
 
M

Mark Rae

I want to use the global.asa file to trigger tasks.

Presumably this is because your site is hosted with an ISP who will not
allow you to deploy Windows services...?
 
P

PeterKellner

I want to use the global.asa file to trigger tasks. Sessions get started
frequently enough to put some code in there to schedule tasks once a day
without resorting to vbs scripts etc which I can't get permission to run.
This works fine but does the code that gets triggered cause the person
starting the session to have to wait until it is finished. I was hoping it
started on another thread. Regards.

Assuming you don't want to make a service out of this, you could use
the session event. You'd have to have some thread safe way to know
that you hadn't started the process already and of course you can
simply create a new thread and fire away. The thread won't die when
the request completes so it should not be a problem.
Peter Kellner
http://peterkellner.net
 
H

Hans Kesting

I want to use the global.asa file to trigger tasks. Sessions get started
frequently enough to put some code in there to schedule tasks once a day
without resorting to vbs scripts etc which I can't get permission to run.
This works fine but does the code that gets triggered cause the person
starting the session to have to wait until it is finished. I was hoping it
started on another thread. Regards.

It's also possible to define a timer in Global.asax that gets started
in Application_Start and triggers a "tick handler" in that same
global.asax every so often.

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top