Skip to main content
All docs
V25.1
  • Why redirect to another page or View does not work on AJAX requests

    This error occurs when you redirect to another page on AJAX requests ( $.ajax()) on the server. For example, when you call the Redirect method in an action method that handles AJAX requests in a controller.

    In this case, return to the initial View and then use JavaScript to redirect to another page.

    Controller:

    return Json(new { newUrl = "https://www.devexpress.com" });  
    

    View:

    $.post('@Url.Action("Save")',  
        function (data) {  
            if(data.newUrl)  
                window.location.href = data.newUrl;  
        }  
    );