Reputation: 2187
I have a asp.net website. Every day at, let's say, 8pm the server executes some operations which last 20 minutes. My question is: how can i redirect the users who access my website during this time to another page on the server? Multithreading?
Upvotes: 0
Views: 75
Reputation: 3510
An option without modifying your app code is to have a scheduled task that renames the App_Offline.htm file back and forwards during your busy time (Assuming you want to say 'site is busy' or something similar)
i.e. at 8pm run a .bat file such as
ren d:\webapp\_App_Offline.htm App_Offline.htm
At 8:20pm run
ren d:\webapp\App_Offline.htm _App_Offline.htm
Not clever, certainly not foolproof but an idea nonetheless that is easy to implement quickly.
Upvotes: 0
Reputation: 6619
A easy way is just to redirect them depending on the time. Use global.asax and implement the function in Application_BeginRequest method.
Maybe not the best solution but a easy to implement.
Upvotes: 1