?
Solved

Back to previous page after login redirect

Posted on 2010-09-05
4
Medium Priority
?
704 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

777 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