Click here to Skip to main content
15,896,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I need to redirect the error page in ajax post response

i have used window.location.href

C#
success: function (r) {                  

                   window.location.href = '/controllername/Actionmethod';
                   


               }, error: function (x, e) {
                   //     alert(x.responseText);
               }

but i need another option instead of window.location.href

help me

thanks in advance
Velsamy
Posted
Updated 3-Feb-15 20:21pm
v2
Comments
Sinisa Hajnal 4-Feb-15 2:54am    
Why do you need another option? In other words, what's wrong with location.href?

Check below link which will give you multiple ways to redirect

How can I use jQuery to redirect to another page?[^]
 
Share this answer
 
window.location = url;
window.location.replace(url);
window.location.assign(url);
 
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