473,418 Members | 2,267 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Delay on logout

Hi all,

I would like to have a delay on a logout page. Here is what I have so far:

logout.aspx
-----------
Page_Load()

FormsAuthentication.SignOut();
Thread.Sleep(5000);
Response.Redirect("homepage.aspx");

What I would like the code to do is, display the logout.aspx page, then wait
5 seconds, then redirect the user to another page.

However, the trouble I'm having is that since I have the delay in the
Page_Load(), the page does not load for 5 seconds, then without displaying,
it redirects to the homepage.aspx.

Any ideas?

Thanks,
Michael
Nov 19 '05 #1
5 2103
Hello Michael,

This will need to happen client side...

Write out some javascript (using Page.RegisterStartupScript) that uses window.setTimeout
and top.location.href.

--
Matt Berther
http://www.mattberther.com
Hi all,

I would like to have a delay on a logout page. Here is what I have so
far:

logout.aspx
-----------
Page_Load()
FormsAuthentication.SignOut();
Thread.Sleep(5000);
Response.Redirect("homepage.aspx");
What I would like the code to do is, display the logout.aspx page,
then wait 5 seconds, then redirect the user to another page.

However, the trouble I'm having is that since I have the delay in the
Page_Load(), the page does not load for 5 seconds, then without
displaying, it redirects to the homepage.aspx.

Any ideas?

Thanks,
Michael

Nov 19 '05 #2
Michael D. Jones wrote:
Hi all,

I would like to have a delay on a logout page. Here is what I have so far:

logout.aspx
-----------
Page_Load()

FormsAuthentication.SignOut();
Thread.Sleep(5000);
Response.Redirect("homepage.aspx");


Try to move Thread.Sleep(5000); to Page_Unload().

--
Software is like sex: it's better when it's free -- [Linus Torvalds]

Fabio Marini - A+, RHCT, MCDBA, MCAD.NET
To reply: news [at] mamakin1976 [dot] plus [dot] com
Nov 19 '05 #3
Thanks, Matt

This works!

<script language="javascript">
function RedirectPage(oSrc,args) {
window.location='http://www.domain.com';
}
</script>
onload="setTimeout('RedirectPage()',5000)"

Michael

"Matt Berther" <mb******@hotmail.com> wrote in message
news:72***********************@news.microsoft.com. ..
Hello Michael,

This will need to happen client side...

Write out some javascript (using Page.RegisterStartupScript) that uses
window.setTimeout and top.location.href.
--
Matt Berther
http://www.mattberther.com
Hi all,

I would like to have a delay on a logout page. Here is what I have so
far:

logout.aspx
-----------
Page_Load()
FormsAuthentication.SignOut();
Thread.Sleep(5000);
Response.Redirect("homepage.aspx");
What I would like the code to do is, display the logout.aspx page,
then wait 5 seconds, then redirect the user to another page.

However, the trouble I'm having is that since I have the delay in the
Page_Load(), the page does not load for 5 seconds, then without
displaying, it redirects to the homepage.aspx.

Any ideas?

Thanks,
Michael


Nov 19 '05 #4
Thanks, Fabio

I appreciate your suggestion.

Michael

"Fabio" <us**@domain.invalid> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Michael D. Jones wrote:
Hi all,

I would like to have a delay on a logout page. Here is what I have so
far:

logout.aspx
-----------
Page_Load()

FormsAuthentication.SignOut();
Thread.Sleep(5000);
Response.Redirect("homepage.aspx");


Try to move Thread.Sleep(5000); to Page_Unload().

--
Software is like sex: it's better when it's free -- [Linus Torvalds]

Fabio Marini - A+, RHCT, MCDBA, MCAD.NET
To reply: news [at] mamakin1976 [dot] plus [dot] com

Nov 19 '05 #5
Hello Michael,

Glad to help... :)

--
Matt Berther
http://www.mattberther.com
Thanks, Matt

This works!

<script language="javascript">
function RedirectPage(oSrc,args) {
window.location='http://www.domain.com';
}
</script>
onload="setTimeout('RedirectPage()',5000)"
Michael

"Matt Berther" <mb******@hotmail.com> wrote in message
news:72***********************@news.microsoft.com. ..
Hello Michael,

This will need to happen client side...

Write out some javascript (using Page.RegisterStartupScript) that
uses
window.setTimeout and top.location.href.
--
Matt Berther
http://www.mattberther.com
Hi all,

I would like to have a delay on a logout page. Here is what I have
so far:

logout.aspx
-----------
Page_Load()
FormsAuthentication.SignOut();
Thread.Sleep(5000);
Response.Redirect("homepage.aspx");
What I would like the code to do is, display the logout.aspx page,
then wait 5 seconds, then redirect the user to another page.
However, the trouble I'm having is that since I have the delay in
the Page_Load(), the page does not load for 5 seconds, then without
displaying, it redirects to the homepage.aspx.

Any ideas?

Thanks,
Michael

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jon Natwick | last post by:
I'm trying to add a dynamically created logout link on my pages. The link to the logout page will show if the user is logged in. I put a placeholder on the aspx page and then dynamically create...
0
by: ShailShin | last post by:
Hi All, Developing an VB App for Login and logout tracking. In App Form there are two buttons login and logout. When user click on login the loginName, LoginTime and LoginDate get stored in...
25
by: crescent_au | last post by:
Hi all, I've written a login/logout code. It does what it's supposed to do but the problem is when I logout and press browser's back button (in Firefox), I get to the last login page. In IE,...
4
by: Frank | last post by:
My program gets a WM_QUERYENDSESSION message and asks the user if it is OK to shutdown. While he's thinking about it, Windows displays a box saying the program is not responding, and if not...
10
by: chaos | last post by:
How to do logout alert message when i press on the logout image <a href="../logout.php" target="_top" onClick="return logout()"...
2
by: riyazthandora | last post by:
Dear guys I have problem with my crystal report especially in the morning in windows 2000 server machine. I am using a VB program and Database as MS Access. Reports are working fine. But sometimes...
1
by: shrik | last post by:
hi everybody. I have following problem. There are two pages. index.jsp and main.jsp in my application Index.jsp contains logging interface in . It submits password and userid to loginform bean. ...
1
by: Kandiman | last post by:
Hiya, i made a asp page, and one of my divs (as a include) is as below. the problem is if the main page is resubmitted, i get logged out again?... heres the code.. i think its on the value=true...
10
by: DavidPr | last post by:
When I logout as one user and log in under a different user, it opens with the last user's information. User 1 - Unsername: Davey Jones User 2 - Unsername: David Smith I log out from Davey...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.