Create an Exit link which returns users to referring page
We are using SharePoint 2007. The users come to my site from a link setup on another site. I need to create an Exit link on the header of my main Site collection. When user clicks on this Exit link they should be send to the site or page they came from.
October 29th, 2010 3:55pm

You have to put one webpar that will store the value of the url they come from and on the top you can put another web part with a button say back to prev url.In that webpart you can read the session variable put by ur first webpartDestin - MCTS SharePoint Application Development 2010,2007
Free Windows Admin Tool Kit Click here and download it now
October 30th, 2010 12:58am

hello of course you can do it via web part, but it is not a best choice for that as it is located on appropriate page and will work only if users will come to this appropriate page. I would suggest you to use custom http module for that. Also instead of session variable you may use cookies (both session and cookies are expired, but if you use session you will need to configure your web.config file in order to increase expiration period, and if you will use cookies you are free to setup this particular cookies as you want. You can configure cookie to be never expired in general). Of course cookies can be disapled in client browsers, but I think currently it is very minor percent from all users. So you will need to perform the following actions: 1. Create custom http module (inheritor of IHttpModule interface) and register it in web.config of your web application 2. In this module on begin request handler you should check HttpContext.Current.Request.UrlReferrer property in order to check whether or not user came from other site. If yes - store it in cookies 3. Create Exit link and in codebehind check is there cookies with UrlReferrer. If they exist - call HttpContext.Current.Response.Redirect(urlFromCookies)Blog - http://sadomovalex.blogspot.com CAML via C# - http://camlex.codeplex.com Graphs visualization in Sharepoint - http://spgraphviz.codeplex.com
October 30th, 2010 12:07pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics