Ok lets say i have these pages in my workbook in this hierachical order:

A -> either B or C -> D

Every page starting from B onwards will have a back button to return to the previous page, so B/C will return to A.

The question is if i'm at D, i expect the back button to take me to either B or C (depends on where i came from). Is there any way to do this?

Background info:
I have some knowledge in ASP so i understand querystrings. Is there any way i can send this data from B/C to D using one? If so, what language do i use?