Link to home
Start Free TrialLog in
Avatar of jkeagle13
jkeagle13

asked on

Code to Link User Back to SharePoint List View

Hello,

I have been fighting for a bit with a pesky problem. I have a SharePoint list item display page from which a user can follow several links from and move forward by clicking links. Users will get two or three pages removed in the history from this portal page.

The link is: http://www.site.com/Lists/Parent/Item/displayifs.aspx?List=e0d68...&ID=3

This is a dynamic page; a page on which I have added other web parts. So, that link will be dynamic - different for each item. A static hyperlink won't work. Users may travel through several different links, so using simply JavaScript to link to document.referrer, etc., won't do the trick. The number of steps removed they are is variable, so I can't rely on a history.go() statement either.

There has to be an elegant way to solve it. Ideal pseudocode would look something like: Set Hyperlink to most recent history page which contains display.ifs.

Thanks,
Joseph Irvine
Avatar of Gary
Gary
Flag of Ireland image

Link not working and I'm not exactly following your question.
Avatar of jkeagle13
jkeagle13

ASKER

The link was meant to be an example and was truncated; this site is on an intranet and isn't accessible to the public.

Basically I have a dynamic URL that is a display form for an item, in the case of the link, item number 3. A user will be on that page, and will navigate off to several different pages. I want something akin to a "back" button - a hyperlink that takes the user back to that display view for the specific item, hopping back over the two or three pages the user may have visited in the interim.

My original code was just a hyperlink to document.referrer as I could put in constraints that would ensure nobody was ever more than one page removed from the list display view. A rule changed that now allows users to visit more than one page.

Thanks!
Ok makes a bit more sense.
Why not just use a Page.Session to hold the url?
ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello,

Brilliant solution, Rainer. Thanks. Amazing in its simplicity. I had disabled dialog windows so that it rendered everything as a page some time ago very early in the development process since it would give me more flexibility at the time.

The dialog window did the trick! Brilliant in its simplicity; amazing how one can miss such obvious things when staring at a problem week in and week out - losing the forest through the trees.

Thanks,
Joseph Irvine