Solved

Back to previous page after login redirect

Posted on 2010-09-05
4
695 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 167 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 167 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 166 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

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

Title # Comments Views Activity
advertisement module in core php 4 144
Why don't I see this table in EDMX file? 2 23
Asp.net mvc foreach 3 32
Message not shown 5 29
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

929 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

13 Experts available now in Live!

Get 1:1 Help Now