In my project ASP.NET I am submitting a data using JQuery.
I need some solution for logout page that still displaying on the user’s browser.
If user will click on the page it will post the request the server.
Although the request may not be proceed on server but I get “success” code on complete event also the status code shown me 200.
Is there any way to prevent submitting AJAX request when user has logged out…?
No, you will not be able to stop the request.
You can control your response to it though.
Return some error code that will tell your script that the user is logged out, and then your javascript can direct the user to a login screen.
If the user is logged out, the 200 response that you are getting is probably the login page. You can check the contents of the response in such cases and detect a logout.