learnerasp 0 Newbie Poster

Hi there,

I have a div tag and working fine till yesterday. Just now I found out a problem which has to be rectified quickly.

I have a div tag. When time out is approaching then we need to pop up the message using div tag. Everything is working fine.

But on the page, where is the div tag is created, at the run time, it is showing the empty space.
How can I remove the empty space (div tag is invisible) on the page.
When I have used style="position: absolute;" the div tag is not shown when the user scrolls down the browser.
So with the help of ppl in this forum, I hv changed to style="position: fixed;"

The same code is working in the other page (it is not showing empty space). But on another page it is showing empty space. The div code is same all through out. I am not able to make out why the same code is working differently on different pages.

Also, the problem is that there is a placeholder in my page and this div tag does not show as it is shown on previous pages.
Please can somebody help me out
Thanks so much!!!!!!!!!

The code I have used is:
Div Tage Code:

Help with Code Tags html Syntax (Toggle Plain Text)

<div onload="blurAll();"  id="userMessage" style="position: fixed; background-color:ButtonFace; z-index: 1; display: block; top: 307px; left: 304px;                             visibility:hidden; border: …
learnerasp 0 Newbie Poster

Hi Airshow and Lucky,
Thanks a lot for your help.
But unfortunately, my problem is still there.
The div tag is still show at the top of the page at run time where i hv placed it.
When I have used to example it is shown and hidden but not at the center of the browser.
The part where I am lost is that the same code is working in the previous page. In this page, I have only a gridview extra.
Can you pls help me out. Its rather very urgent :(
This has to go to production by monday night and I hv two days left and trying hard to work on it.
Thanks so much for your help and time
Thanks a lot in advance
Regards

learnerasp 0 Newbie Poster

Hi,
In the div tag, place this under the style
<div style="position:fixed">
</div>
Check this link
http://www.vikramlakhotia.com/Scrollable_Div_position_and_Post_back.aspx
Hope that I could help you.

learnerasp 0 Newbie Poster

Hi there,

I have a div tag and working fine till yesterday. Just now I found out a problem which has to be rectified quickly.

I have a div tag. When time out is approaching then we need to pop up the message using div tag. Everything is working fine.

But on the page, where is the div tag is created, at the run time, it is showing the empty space.
How can I remove the empty space (div tag is invisible) on the page.
When I have used style="position: absolute;" the div tag is not shown when the user scrolls down the browser.
So with the help of ppl in this forum, I hv changed to style="position: fixed;"

The same code is working in the other page (it is not showing empty space). But on another page it is showing empty space. The div code is same all through out. I am not able to make out why the same code is working differently on different pages.

The code I have used is:
Div Tage Code:

<div onload="blurAll();"  id="userMessage" style="position: fixed; background-color:ButtonFace; z-index: 1; display: block; top: 307px; left: 304px; 
                            visibility:hidden; border: 3px solid blue; width: 383px;">  
       <table style="width: 388px; height: auto; background-color:Blue;"> 
       <thead align="left" title="Registration - Warning">
                <tr>
                    <td style="color:White;">Registration - Warning
                    </td>
                </tr>
       </thead>
       </table>                                               
       <table style="width: 388px; height: auto; background-color:ButtonFace;"> 
             <tr> <td><img src="triangle.jpg"id="img"  alt="warning" /></td>
         <td>
           You are inactive for sometime. Your session will expire in …
learnerasp 0 Newbie Poster

Hi Essential,
Thanks so much for your help and time.
Will be waiting for the code :)
Regards

learnerasp 0 Newbie Poster

Hi Essential,
Thanks so much.
But just want to ask you, where should I place your code.
I tried to put in the script tag. and When I run the program it is actually opening another window (in ur code I found out that u are using window.open('') ).
Another window should not be opened.
When the div alert is shown only then the buttons on the browser should not be clicked, just like javascript alert box does not allow us to clik on the browser until we do some action to the alert box.

Can you pls help me to place the code?

Thanks so much for your help.
Regards

learnerasp 0 Newbie Poster

Hi All,
I need help on this. I am a new bie in javascript
When javascript alert is popped up, it doesnot allow us to focus on the window till we click on the alert ok button.
Can we do the same when I popup div alert.
I have put in the code in a function to call when div is loaded. But its not working
The code I am using is:

<div onload="blurAll();" id="exitMessage" style="position: fixed; background-color:ButtonFace; z-index: 1; display: block; top: 307px; left: 304px; 
visibility:hidden; border: 3px solid blue; width: 250px;"> 
function blurAll()
{
// alert("blur");
//window.blur();
window.focus=false; 
}

But it seems like its not working, Even the alert is also not popping up,
Thanks so much in advance
Regards

learnerasp 0 Newbie Poster

Hi Billymcguffin,

Thanks so much for your help, it worked like a wonder.
Its been so simple ofcourse its like a giant task for me since I did not know how to work on div tag and was wasting 2 days of my time trying different codes
Thanks so much.

also, I have one more query.
When javascript alert is popped up, it doesnot allow us to focus on the window till we click on the alert ok button.
Can we do the same when I popup div alert.
I have put in the code in a function to call when div is loaded. But its not working
The code I am using is:

<div [B]onload="blurAll();"  [/B]id="exitMessage" style="position: fixed; background-color:ButtonFace; z-index: 1; display: block; top: 307px; left: 304px; 
                        visibility:hidden; border: 3px solid blue; width: 250px;"> 
function blurAll()
{
   // alert("blur");
    //window.blur();
     window.focus=false; 
}

Thanks so much in advance
Regards

learnerasp 0 Newbie Poster

Hi There,

I need help badly on the div tags. I dont have much knowledge on div tags
I have a div tag in my code and it should be show when there is an inactivity. Its working fine, until today I found a bug.
When I scroll my browser to the end, the div is still shown at the upper part of the browser.
Unless i scroll up (as a programmer, I know that div will be showing up but ofcourse user will not know) I dont know whether the div is shown.

Whether the user scrolls up or down, he should be viewing the alert which I show him.
How can I solve this?
My Div tag code:

<div onload="blurAll();"  id="userMessage" style="position: absolute; background-color:ButtonFace; z-index: 1; display: block; top: 307px; left: 304px; 
                            visibility:hidden; border: 3px solid blue; width: 383px;">  
               <table style="width: 388px; height: auto; background-color:Blue;"> 
                   <thead align="left" title="Registration - Warning">
                            <tr>
                                <td style="color:White;">Registration - Warning
                                </td>
                            </tr>
                   </thead>
               </table>                                               
               <table style="width: 388px; height: auto; background-color:ButtonFace;"> 
                     <tr> <td><img src="triangle.jpg"id="img"  alt="warning" /></td>
                     <td>
                       You are inactive for sometime. Your session will expire in 5 min.<br />
                       Do you wish to extend?
                     </td>
                     </tr>                           
                      <tr><td></td><td align="center">
                      <asp:Button CssClass="groupButton" ID="btnStillHere" OnClientClick="doRefresh()" Text="OK"  runat="server" Width="60px" />
                      <input type="button" class="groupButton" id="btnDoNothing" onclick="hideUserMessage()"  value= "Cancel" runat="server" />
                      </td> </tr> 
                 </table>
            </div>

Thanks so much in advance.
Regards

learnerasp 0 Newbie Poster

Hi Essential,
I hv tried and worked the code,
I checked that when confirm box is generated, the timer stops.
That means if you dont click ok or cancel buttons for more than 5 min, the counter still stays at 17 seconds.
Actually, I need that even if confirm box is generated and there is no actiion, the timer should countdown and once its zero, then redirect to login page.
any solution?
Regards

learnerasp 0 Newbie Poster

Hi essential,
Thanks for the reply.
I will try to check and see if it works.

Meanwhile, here is the code I am using

<input type="text" readonly="readonly"  id="counter" style="text-align:center; font-size:x-large; font-weight:bold; color:Red;" />
 <input type="text" readonly="readonly"  id="counter1" style="text-align:center; font-size:x-large; font-weight:bold; color:Red;" />

<input type="hidden" id="hh" />
 <input type="hidden" id="HidHours" value="<%=HidH.Value%>"/>

<input type="hidden"  id="HidMinutes" value="<%=HidM.Value%>"/>

<input type="hidden"  id="HidSeconds" value="<%=HidS.Value%>"/>

<asp:HiddenField ID="HidH" runat="server" Value="0" />

<asp:HiddenField ID="HidM" runat="server" Value="0" /> 

<asp:HiddenField ID="HidS" runat="server" Value="0" />

<script language="javascript" type="text/javascript">

var hours=document.getElementById('HidHours').value; 
var minutes=document.getElementById('HidMinutes').value;
var seconds=document.getElementById('HidSeconds').value;
var hoursFirst=document.getElementById('HidHours').value; 
var minutesFirst=document.getElementById('HidMinutes').value;
var secondsFirst=document.getElementById('HidSeconds').value;
var booleanVal=true;
function display()
{ 
        if (seconds<=0)
        {
            if ((hours==0)&&(minutes==0)) 
                seconds=0;
            else
            {
                seconds=60;
                minutes-=1; 
            }
        } 
        if (minutes<=0)
        { 
            if ((hours<0)&&(minutes<0)) 
            {
                hours = minutes = seconds = 0;
            }
            else 
            {
                if ((hours==0)&&(minutes==0)) 
                    hours=minutes=0;
                if ((hours>0)&&(minutes<0)) 
                {
                    minutes=59;
                    hours-=1; 
                }
            }
        } 
        if ((minutes<=-1)||(hours<=-1))
        { 
            if (hours<=-1) 
            {
                minutes=0;
                hours+=1;
            }
            else
            {
                minutes-=1;
                seconds=0; 
                minutes+=1; 
            }
        } 
        else 
            if (seconds>0) 
               seconds-=1;
            if (seconds <= 9 && seconds.toString().length < 2)
                   seconds = "0"+seconds;
            if (minutes <= 9 && minutes.toString().length < 2)
                    minutes = "0"+minutes;
            if (hours <= 9  && hours.toString().length < 2)
                    hours = "0"+hours;

//            document.getElementById('counter').value=hours+":"+minutes+":"+seconds; 
            window.status = "Your session will expire in " + minutes+":"+seconds + " if you are inactive."

            if ((minutes == 1) && (seconds == 0)) //&& (days == 0))
            {
//               document.getElementById('hh').value = minutes;

//               RunForMinutesBeforeConfirm();
                // setTimeout("display1(hours,minutes,seconds)",1000);
                var x = 2;
//                KeepRunningTimer(x);
                x=confirm("Do you want to extend");
                 //if (confirm("Do you want to extend")==1)
                 if (x==1)
                 {

                      hours = document.getElementById('HidHours').value; …
learnerasp 0 Newbie Poster

Hi There,

I have created a javascript count down timer to be used in asp.net.
Thanks to the author of the article for making my life half simple.

Basically, I create a countdown time for user to register (20 mins). If the countdown is around 5 min (that means the user is inactive for 15 min) then generate confirm box asking whether the session has to be active.

If the user clicks ok, then we reset the time. If cancel is clicked, we proceed with the timer countdown till it reaches zero and logged out. IF he doesnot do any action, the countdown timer will proceed and logged out

I hv created the scenario for the above except that I have the below problem
The problem is
Whenever the confirm box is popped up, the timer counter stops the counting.
and If user does not click on either button and remain inactive for more than 5 min (by 5 min, the user should be logged out) there is nothing done that means, the counter stops countdown and the user is not logged out.

Is there anywhere to determine in javascript whether a confirm box is popped up?

Hope i am clear.
Can somebody help me out..
I got stuck with this for the past few days and I am also a novice in javascript.

Thanks a lot in advance
Regards

learnerasp 0 Newbie Poster

Hi there,
I want to use a web timer control in asp.net but the problem is I dont know how to use it. :(

The requirement is as follows:
The user will login to register for exam.
Solution I hv designed:
Once he has login we will enable the login time (say 15 min.) We will store the initial login time in the data base. When ever there is an activity we will update the field in the database with latest time.

Is this the correct approach or is there any other way to do this?

The problem is if there is no activity for 15 min, before we end the session, we need to show the popup to the user "your time expiring soon" Do you wish to continue?
If user clicks on ok, then we extend the time.

Is there any way to achieve this.
I hv been trying al the codes i found on the internet but nothing seems to help me or may be I am not able to use them :(

I need this one urgently!!!!
Pls help me out on this!!!
Thanks a lot in advance!!
Regards