Solved

C# ASP redirect to homepage on going back

Posted on 2012-04-07
7
386 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
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 tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now