Click here to Skip to main content
15,887,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
How to do the page redirection in javascript


loginvalidate()
{
if {
window.location("NewPassword.aspx");
}
}

forgotvalidate()
{
if
{
window.location("Login.aspx");
}
}
Posted
Updated 21-Dec-15 2:11am
v2
Comments
Amit Jadli 21-Dec-15 7:46am    
You could do by.
window.location("YOUR URL");
AnvilRanger 21-Dec-15 7:47am    
Is Google broken for you? Please at least attempt to find the answer to your question before posting it. A simple search would have given you thousands of results.
Member 12165191 21-Dec-15 7:49am    
i was tried all these then only i questioned here.
AnvilRanger 21-Dec-15 7:58am    
If you have tried something then you need to include the code in your question and the issues you are having with as much detail as possible.

Remember that we cannot see your screen or read your mind so we have no idea what you have attempted or what issues you are having.
Member 12165191 21-Dec-15 8:13am    
the first function working correctly window.location(NewPassword.aspx) it moves to that page.
in the second function also it move to the NewPassword.aspx. it won't move to Login.aspx

Hi,

You have to use :
JavaScript
window.location="URL";
to do a page redirect using JavaScript at client side


please see this link to solve your query.

thanks.


http://www.tutorialspoint.com/javascript/javascript_page_redirect.htm[^]
 
Share this answer
 
You can use this code too :

JavaScript
window.location.href = "Default2.aspx";


Refer :

http://www.w3schools.com/jsref/prop_loc_href.asp[^]

Good luck
 
Share this answer
 

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