Solved

C# ASP redirect to homepage on going back

Posted on 2012-04-07
7
392 Views
Last Modified: 2013-12-17
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
0
Comment
Question by:pauledwardian
7 Comments
 
LVL 20

Assisted Solution

by:BuggyCoder
BuggyCoder earned 166 total points
ID: 37818548
0
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 167 total points
ID: 37819029
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
 

Assisted Solution

by:pauledwardian
pauledwardian earned 0 total points
ID: 37820321
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
 
LVL 16

Accepted Solution

by:
theo kouwenhoven earned 167 total points
ID: 37845850
Hi  pauledwardian,

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

Regards,
Murph
0
 

Author Closing Comment

by:pauledwardian
ID: 37923301
Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question