|
-
Jul 14th, 2010, 08:57 PM
#1
Thread Starter
Addicted Member
Prevent Back button on the browser
Hello There,i just like to ask if you have any idea of preventing the Back button of the browser to navigate back to the previous page after a user log in.
Ex:After a user successfully logged in to my website and he/she hit the Back button of the browser.I want this to not redirected to the previous page instead redirected to the same page which is my Main page.Also after a user logged out to my website and again he/she hit the Back button of the browser.I also want this to not redirected to the previous page instead redirected to my login page.
hope you get my point..
Thank you very much in advance..BTW,im using C#
glen
-
Jul 14th, 2010, 11:41 PM
#2
Frenzied Member
Re: Prevent Back button on the browser
You Don't Have to Rate Me.
I'm Not a Civilized Man I'm the Civilization it self
White or Black, Living or Dieing and 0 or 1 that's MY life
iam an Object in Object Oriented Life
my blog : http://refateid.blogspot.com/
twitter : @avrail
010011000111010101110110001000000100110101111001001000000101000001100011 
-
Jul 15th, 2010, 01:31 AM
#3
Re: Prevent Back button on the browser
Hey,
The simple answer is, there is no sure fire way of preventing the user from clicking the back button. At the end of the day, it is their back button, and they can click it if they want to 
The question really is why are you wanting to prevent this?
Is it just that you don't want the user to see the login page if they are already in? If so, there are a number of other ways of doing this.
Gary
-
Jul 15th, 2010, 01:51 AM
#4
Thread Starter
Addicted Member
Re: Prevent Back button on the browser
 Originally Posted by gep13
Hey,
The simple answer is, there is no sure fire way of preventing the user from clicking the back button. At the end of the day, it is their back button, and they can click it if they want to
The question really is why are you wanting to prevent this?
Is it just that you don't want the user to see the login page if they are already in? If so, there are a number of other ways of doing this.
Gary
sorry gary if it is a little bit confusing..your right,if a user has logged in and he/she hit back button then it stays on the current page.and also if a user has logged out and he/she hit the back button then he/she redirected to the login page..thats all.
-
Jul 15th, 2010, 01:53 AM
#5
Re: Prevent Back button on the browser
How are you doing your user authentication? Are you using Forms Authentication, or are you using the built in ASP.Net Membership Provider?
Gary
-
Jul 15th, 2010, 02:02 AM
#6
Thread Starter
Addicted Member
Re: Prevent Back button on the browser
 Originally Posted by gep13
How are you doing your user authentication? Are you using Forms Authentication, or are you using the built in ASP.Net Membership Provider?
Gary
yes,gary i am using Forms Authentication.
-
Jul 15th, 2010, 02:08 AM
#7
Re: Prevent Back button on the browser
Hey,
Have a look here:
http://www.devhood.com/tutorials/tut...tutorial_id=85
Notice how you can provide a default url to the login page, when "protected" pages are attempted to be accessed? also, how you can make pages only availalble to certain users, i.e. authenticated, anonymous, etc.
Gary
-
Jul 15th, 2010, 02:28 AM
#8
Thread Starter
Addicted Member
Re: Prevent Back button on the browser
Hi Gary,are u sure that this is not a dead link?..because i cant browse it here in the office..
-
Jul 15th, 2010, 02:34 AM
#9
Re: Prevent Back button on the browser
Nope, it works fine for me.
I am looking at the page just now.
What about these:
http://ondotnet.com/pub/a/dotnet/200...rmsauthp1.html
http://www.15seconds.com/issue/020220.htm
They are very similar.
Gary
-
Jul 15th, 2010, 02:43 AM
#10
Thread Starter
Addicted Member
Re: Prevent Back button on the browser
Thanks Gary im reading it right now..
-
Jul 15th, 2010, 02:51 AM
#11
Re: Prevent Back button on the browser
No probs, just post back if you have any other questions.
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|