Hi @Dondon510 ,
How to redirect to /Home from server side after logged in?
According to your code, since you are using JavaScript to call the login method, after calling the login method success, to redirect to the home page, you could use the window.location.href
property, like this:
ajaxCallPostWithHeaders('@Url.Action("Login", "User")', params, headers, function (result) {
if (result.result == true) {
_userObj = result.payload.data;
//redirect to Home page.
// window.location.href ="/Home";
//based on your comment to change the code as below:
window.location.href ="/prime/test/v1/Home";
} else showError(result.message, 'PTHelper');
});
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion