Solved

Showing alert() even though IE is Minimized how?

Posted on 2003-12-12
2
222 Views
Last Modified: 2010-04-06
Hello Experts,

       My purpose is to show an alert message when the session is about to expire. But the problem with the alert is that the user can see it only when the IE is active. I would like to know of a method of displaying warning messages wherein the message display would pop up even if the IE is not active / in a minimized state.


Thanks
Bharat
0
Comment
Question by:bharat_mane
2 Comments
 
LVL 5

Accepted Solution

by:
prohacx earned 100 total points
ID: 9928344
Hi there!

Indeed, the alert is not pushed through if your IE is minimized...

I tried it with a showModalDialog in stead of an alert and set focus to your window before calling the showModalDialog and it works fine with me:


<%@ Language=VBScript %>
<%
      session.Timeout = 2
%>

<HTML>
<HEAD>

<%
Response.Write "<script type=""text/javascript"">" & vbcrlf

Response.Write "var minutesLeft = " & session.Timeout & ";" & vbcrlf

Response.Write "function checkTimeout() {" & vbcrlf

Response.Write "      if (minutesLeft == 1) { " & vbcrlf
'Response.Write "            alert('Your session will expire in 1 minute!'); " & vbcrlf
Response.Write "            window.focus();" & vbcrlf
Response.Write "            window.showModalDialog('warn.html','','help: no;');" & vbcrlf
Response.Write "" & vbcrlf

Response.Write "      }" & vbcrlf

Response.Write "      minutesLeft -= 1;" & vbcrlf
Response.Write "      setTimeout(""checkTimeout()"", 60000);" & vbcrlf

Response.Write "}" & vbcrlf

Response.Write "</script>" & vbcrlf
%>

</HEAD>
<BODY onload="checkTimeout();">

<P>wait for an alert...</P>

</BODY>
</HTML>

Have fun!
0
 

Author Comment

by:bharat_mane
ID: 9933050
hi  prohacx,

    This is cool, thanks a lot it works well..
Thanks once again
 
   
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

821 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