mike55 Posted December 1, 2004 Posted December 1, 2004 Hi all, Ok, when I log out of my application I am going to redirect to a new page, called logout.aspx. This page is responsible for deleting session variable and resetting all other variables. Now I would like to add in a function that 10 second after the page loads the user automatically get redirected to another page, in this case say google.com. Now this is what I was thinking of doing... 1. Loading my page as normal but in the page load() method calling a function called page_Redirect. 2. In the page_Redirect method, I will declare a variable x and let it equal to the current time. I also have a boolean variable which is currently equals to false. 3. I have a while loop that does the following (this is only pseudo code): dim result as boolean = false while result = false if time = (x+10sec) then result = true Response.redirect("www.google.com") end if end while Am I approaching the problem the correct way, or is their a simplier way to do what i want to do. Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
HJB417 Posted December 1, 2004 Posted December 1, 2004 I would use the FormsAuthentication class for login/logout and use either javascript or insert a html meta refresh tag to do the delayed redirect. Quote
mike55 Posted December 1, 2004 Author Posted December 1, 2004 I would use the FormsAuthentication class for login/logout and use either javascript or insert a html meta refresh tag to do the delayed redirect. Thanks for the reply. Why would you use the FormAuthentication class for logout? Can understand it for the login, and have used it in other projects for the log in. Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
Misha Posted December 1, 2004 Posted December 1, 2004 Mike55, I used the following tag to do the same thing: <head> <META HTTP-EQUIV="refresh" content="3;URL=http://www.google.com"> </head> number "3" specifies the time in seconds before redirecting. Quote
mike55 Posted December 1, 2004 Author Posted December 1, 2004 Thanks Misha Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
*Gurus* Derek Stone Posted December 1, 2004 *Gurus* Posted December 1, 2004 Using code like this is an awful practice. It can and will annoy the user and mess up the flow of history in the browser. In other words, it will render the back button useless for some less-adept users. Either redirect to a page on the server (which sends a 30[0-4] response code) or don't do it at all. Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.