Solved

display a popup msg when server is going down in 30 minutes

Posted on 2012-04-02
5
276 Views
Last Modified: 2012-08-13
Hi experts,

I have a website and would like to notify to our users when they are working on their end.  I want to send a prompt message in 15 minutes before the server is went down at 10:00pm.

I have set a timer

 DateTime startTime = DateTime.Now;
 DateTime myDateTime = DateTime.Now.Date.AddHours(22); // 22 is 10:00pm

I want to have a function to validate for timing.

If 9:45 pm an automate popup message is displayed and it says.  Our server is going down in 15 minutes.  Please save your work and exit out the website.

Any help would be greatly appreciated.
0
Comment
Question by:terminator_vn
  • 3
5 Comments
 
LVL 21

Expert Comment

by:Dale Burrell
ID: 37799288
2 options:

Easy (but less flexible), on each page load store the time the server is going down in JavaScript. Then have a little JavaScript polling function that checks the time and when its 15mins to go pops up the alert box.

Harder (but more flexible way), have the JavaScript use AJAX to poll the server, and the server returns the time its going down. The server needs an AJAX/JSON response function. This will still work if you change the time the server is going down while a client is on the page.
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37799579
0
 

Author Comment

by:terminator_vn
ID: 37800829
Thank you for responding.  Do you have a specific example that allow the popup message in 15 minnutes before its server goes down.  I have a server nightly maintenance at 10:00pm.  At 9:45 pm..I would like to have an automate popup message to alert that ..a server is going down in 15 mins.  

Thanks in advance.
0
 

Accepted Solution

by:
terminator_vn earned 0 total points
ID: 37807537
I have found my solution:

DateTime startTime = DateTime.Now;
DateTime MyTime = DateTime.Now.Date.AddHours(20); // 20:00 hours = 10:00 PM

if ( startTime >= MyTime)

{
 showpopup("server is going down");
}
0
 

Author Closing Comment

by:terminator_vn
ID: 37822742
I have found my solution...
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now