Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In one page list of records display.When I click on edit button of that record it redirect to new page and again when I click on back button it will redirect to my first page.Now when I am redirecting to first page I want previous page URL i.e second page URL using javascript...
i.e I want previous page URL using javascript
Posted
Comments
thatraja 26-Jul-11 20:59pm    
Use 'Add comment' link below the answers, don't post your message as answers.

Try this:

document.referrer
 
Share this answer
 
Comments
thatraja 26-Jul-11 20:58pm    
[Comment from OP]
I have tried document.referrer.... But it is norwoorking...
<a href="javascript: history.go(-1)">Back</a> // This will get you to the previous page

C#
javascript:location.href=document.referrer;
// This will give you the prev page url

For more information please review this link;

http://www.exforsys.com/tutorials/javascript/javascript-history-object-properties-and-methods.html[^]
 
Share this answer
 
v2
Comments
thatraja 26-Jul-11 20:59pm    
[Comment from OP]
I have tried document.referrer.... But it is norwoorking...
Member 4684032 27-Jul-11 0:42am    
I have tried document.referrer.... But it is not working...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900