C# ASP redirect to homepage on going back

This is my first experience with ASP.
How can I code that if the user clicks on Back in IE, it directs him to the main page?

Thanks,
Paul
pauledwardianAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
MurpheyConnect With a Mentor Application ConsultantCommented:
Hi  pauledwardian,

Don't go for the Backbutton-stuff, use AJAX script to build your pages.

Regards,
Murph
0
 
käµfm³d 👽Connect With a Mentor Commented:
Generally speaking, users clicking the back button means they are not doing anything on your site. Rather they are moving back to a previous page that has been cached (already downloaded) onto their machines. The only way you can do anything related to this action is by way of Javascript, which I believe BuggyCoder has pointed you to. Know that since you will be reliant on Javascript, you will need to have a fallback for users who do not have Javascript enabled (or the obscure browser which either doesn't support the techniques outlined in BuggyCoder's links or doesn't support Javascript at all). Having a notice that states your pages relies on Javascript and not letting anyone continue past the home page may suffice.
0
 
pauledwardianConnect With a Mentor Author Commented:
Good tips.
I do a pop up message to users that says the submition is successful(Submition of the form to database) and then if the user clicks on Back (in IE) it shows that messagebox again.
I want that to ignore the messagebox on going back and instead directs to the main page.
I heard about Post Back but since this is my first ASP project, I have no idea what that does!!
What do you guys think?

Paul
0
 
pauledwardianAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.