I have a visualforce page which shows list of a custom object records in which id of another customobject id is passed in the url .One column shows the Account name which has lookup relationship with the custom object.I have one button mycommandbutton in each row and on click this will show the contact records for that account only in a different vf page.
I want to add one back link in my 2nd vf page so that it will go to the first vf page. My first vf page contains the customobject record id in the url and 2nd one account Id.i am not sure how to capture the customobject record id from the 2nd page so that it will navigate to first page again.
<apex:commandButton value="mycommandbutton" action="{!$Page.my2ndpage +'?id=' +obj.Account__r.Id}" immediate="true">