Make some web pages halt for a while?
-
How can i make some web pages from my web application halt for a while on a defined time (maybe from 10h to 10h10) and then works again. Besides, i don't know how to threat (response) if some people acess to that page on the halt time. Can you help me? Thanks!
-
How can i make some web pages from my web application halt for a while on a defined time (maybe from 10h to 10h10) and then works again. Besides, i don't know how to threat (response) if some people acess to that page on the halt time. Can you help me? Thanks!
You can set up some code in a base page class that refuses to process requests for a time, and in that time instead returns a warning. Christian Graus - Microsoft MVP - C++
-
You can set up some code in a base page class that refuses to process requests for a time, and in that time instead returns a warning. Christian Graus - Microsoft MVP - C++
Can you give me a little more information. A base page class here means global.asax or the main control class in 3-tiers, and how can we coding to refuse the request, return a warning. I'm sorry, i used to work in Win App and ASP.NET is a brand new for me. I'm really need it to accomplish my project, can you help me. Thanks!
-
Can you give me a little more information. A base page class here means global.asax or the main control class in 3-tiers, and how can we coding to refuse the request, return a warning. I'm sorry, i used to work in Win App and ASP.NET is a brand new for me. I'm really need it to accomplish my project, can you help me. Thanks!
Blue_Skye wrote: A base page class here means global.asax or the main control class in 3-tiers It means you create a class derived from the Page class, and derive all your pages from that. Then all your pages have access to this method. I'm thinking if you put DateTime.Now into a session variable, then you can grab it, check it against the current time, and if the right amount of time has not elapsed, then you show your warning page, or put a warning on the current page. Have some sort of flag which all your other code will have to check to stop it doing any processing. Of course, processing WILL happen ( your server resources will be used ), but the user will not progress from where they are. Christian Graus - Microsoft MVP - C++
-
Blue_Skye wrote: A base page class here means global.asax or the main control class in 3-tiers It means you create a class derived from the Page class, and derive all your pages from that. Then all your pages have access to this method. I'm thinking if you put DateTime.Now into a session variable, then you can grab it, check it against the current time, and if the right amount of time has not elapsed, then you show your warning page, or put a warning on the current page. Have some sort of flag which all your other code will have to check to stop it doing any processing. Of course, processing WILL happen ( your server resources will be used ), but the user will not progress from where they are. Christian Graus - Microsoft MVP - C++
-
i thinks that i'll add some code on the page load to check if time now is on the range from 10h to 10h5. If it is, i will redirect to a warning page. Is it ok? Thanks for your reply
You need to check the difference between now and a time you stored ( when you last allowed access ). Then it will work. Christian Graus - Microsoft MVP - C++