Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Back to previous page after login redirect

Posted on 2010-09-05
4
Medium Priority
?
710 Views
Last Modified: 2012-05-10
I want to be able to do the following, any ideas.

User logins into the site and they are redirect to their account details page automatically on successful login. On the account details page though I want to have a back button which will take them back (and refreshed to pick up new stuff because they are logged in) to the page they where on when they clicked Login in the banner.

So this is what currenlty happens;

1. User is on any page in the site, they click on login in the banner and they go to the login page
2. On the login page if they successfully login they are redirect to their account details page
3.On the account details page i want to have a back button which will take the user back to whatever page they where on when they clicked on login in the banner

any ideas?
0
Comment
Question by:AWSHelpdesk
  • 2
4 Comments
 
LVL 21

Accepted Solution

by:
Dale Burrell earned 668 total points
ID: 33608740
Pass the URL of the page they are on when they click login through as a querystring parameter.
0
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 668 total points
ID: 33608745
>1. User is on any page in the site, they click on login in the banner and they go to the login page

set onclick event of the button to record/save the current page before going to the login page.

save it on client side :
- cookie, hidden input, ajax (not a good idea)
create a cookie with js : http://www.w3schools.com/JS/js_cookies.asp

save it on the server side :
 the referer : http://www.beansoftware.com/ASP.NET-FAQ/Referrer-URL.aspx
store it :
- cookie : http://msdn.microsoft.com/en-us/library/system.web.httpresponse.cookies.aspx
-  in a control (hidden) or session variable : http://codeforeternity.com/blogs/technology/archive/2007/12/19/handling-asp-net-session-variables-efficiently.aspx
0
 
LVL 14

Assisted Solution

by:robasta
robasta earned 664 total points
ID: 33609021
www.yoursite.com/originalpage.aspx

When the user clicks login - 'originalpage.aspx' will be appended to the querystring. it will be something like:

www.yoursite.com/login.aspx?ReturnUrl=originalpage.aspx

get the ReturnUrl query string and pass it to the account details page so that it becomes

www.yoursite.com/myaccount.aspx?ReturnUrl=originalpage.aspx....

then get the ReturnUrl and add it as the link for the back button.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 33764025
Thanks for the points!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

963 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