This is a migrated thread and some comments may be shown as answers.

Controlling the back button

4 Answers 137 Views
Getting started with ASP.NET
This is a migrated thread and some comments may be shown as answers.
Sébastien Richer
Top achievements
Rank 2
Sébastien Richer asked on 14 Dec 2006, 04:38 PM
Hello,

Please don't assassinate me :-)

I want to control my user's back button. I want that when he enters a specific page, I set the previous page to something I want.

This is not to annoy the user ;-) It is because I use RadWindow and usability problems have risen with that usage.

I think I'll post in the RadWindow forum also.

Thanks, cheers !
Sébastien Richer

4 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 22 Dec 2006, 11:58 AM
Hello Sebastien,

You can handle the backspace key using the onkeydown client-side event and to redirect a user to another page using

location.href = "my_new_page.html"

Regards,
Valentin.Stoychev
the telerik team
0
Stuart Hemming
Top achievements
Rank 2
answered on 05 Mar 2007, 10:27 PM
Does that work in all browsers?

I only ask 'cos I regularly visit a page that traps 'shortcuts' in IE very well, but they claim not to be able to do the same thing for FF.

--
Stuart
0
Stuart Hemming
Top achievements
Rank 2
answered on 05 Mar 2007, 10:30 PM
Sébastien,

you need to be really sure of your audience; I don;t know why but start messing with the back button and once mild-mannered users will turn in to rabid, hate-filled psychopaths.

I'm not saying don't to it, just be careful if you do and make sure you don properly rated flameproof clothing before you release it.

--
Stuart
0
Kevin
Top achievements
Rank 1
answered on 06 Mar 2007, 06:47 AM
I believe in a radWindow scenario, the approach suggested by telerik would do. You can see  variations of this for example:

javascript:history.go(-1)

however this has its share of issues too. And when it comes to AJAX updates, making back button work is a major, major pain which requires all sorts of hacks.
Tags
Getting started with ASP.NET
Asked by
Sébastien Richer
Top achievements
Rank 2
Answers by
Valentin.Stoychev
Telerik team
Stuart Hemming
Top achievements
Rank 2
Kevin
Top achievements
Rank 1
Share this question
or