0

Let's say I have a page called subpage.aspx that my web site visitor is viewing. On that same page is the option link to log into the site. That link will take the user to a page called login.aspx, which will have a login form, allowing users to put in their proper credentials to log-in. When that visitor clicks submit and is authenticated, I want him/her to go back to subpage.aspx because that was the last page they were on before they landed on login.aspx.

Is this possible in SharePoint 2010 or 2013? If so, what are some easy options for doing something like this, that won't break my system?

Thanks!

1 Answer 1

3

This can be done by specifying a Return URL in the form URL by providing a value to Source querystring. For example:

http://<site>/Announcements/Forms/NewItem.aspx?Source=http://<site>/default.aspx

Here when a user clicks on OK button in Announcements New form, the user is redirected to deafult.aspx page rather than the AllItems.aspx page of the Announcements list. More information here: http://blogs.msdn.com/b/alexma/archive/2006/06/17/635346.aspx?Redirected=true

4
  • Thank you for the good start...but how can I tell my login.aspx page to reference the previous page's URL so that can be automatically set as source?
    – klewis
    Commented Jan 27, 2014 at 11:32
  • When redirecting the user to a login page, append the current page's url in Source query string. Commented Jan 27, 2014 at 12:16
  • Specifically where is the authentication being handled in SharePoint 2010, when users attempt to log-in?
    – klewis
    Commented Feb 26, 2014 at 22:10
  • Have a look at HttpModules, see this link for more info: thedotnotcorner.com/2012/06/07/… Commented Feb 27, 2014 at 5:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.