Click here to Skip to main content
15,912,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I redirect to a new page that exists in another asp folder using javascript?
Posted
Updated 7-Oct-10 1:11am
Comments
Ankur\m/ 7-Oct-10 8:34am    
I hope you don't contribute to the down-votes to the answers. If you do, kindly put a comment stating the reason.
Goutam Patra 7-Oct-10 8:46am    
Exactly, someone randomly downvoted all the answers. Even when all the answers are correct.
deepak thomas 12-Oct-10 2:34am    
sorry,sorry for my mistakes.i started using this site only for a few weeks.what actually happened?Is my vote became downvote?is the Accept Answer gives you vote?.

Please write this code in your javascript function.

var url = document.URL.toString();
var index = url.indexOf("OldFolder/");
var newUrl = url.substring(0,index);
newUrl = newUrl + "/NewFolder/NewForm.aspx";
location.href = newUrl;


If this helped you then please vote and Marked as answer.
 
Share this answer
 
Comments
deepak thomas 7-Oct-10 6:00am    
we have done like this

window.location="/foldername1/foldername2/test.aspx";

and now getting the page correctly.
NMehta83 7-Oct-10 6:03am    
then please vote. :)
deepak thomas 7-Oct-10 6:04am    
thanks got hint from your code "/NewFolder/NewForm.aspx".
location.href=url;
location.reload;
 
Share this answer
 
v3
Comments
deepak thomas 7-Oct-10 6:00am    
we have done like this

window.location="/foldername1/foldername2/test.aspx";

and now getting the page correctly.
Ankur\m/ 8-Oct-10 1:31am    
Don't worry, I am giving you a 4 to make it up!
 
Share this answer
 
Comments
Goutam Patra 8-Oct-10 1:51am    
Thank you Ankur for your comment and vote. I am not at all worried about any point. But a correct answer doesnt deserve a downvote. Its odd. and have a 5 from me.
Ankur\m/ 8-Oct-10 1:55am    
Thanks! :)

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