0

i am new to MVC4. i am using ASP.net forms authentication. in all page loads i am able to handle authentication and authorization.

i am using Ajax requests in case of Partial views and to return a object.

in case of partial views i am able to find manage by checking Ajaxrequest by following this

in case of object return how to handle authentication for all ajax requests?

My end goal is to intimate that your session time out or at least to redirect to login page

2 Answers 2

1

You can take a look at Prevent Forms Authentication Login Page Redirect When You Don’t Want It by Phil Haack

Sign up to request clarification or add additional context in comments.

Comments

0

Decorate your action methods with [Authorize] attribute.

1 Comment

i am using [Authorize] by that i am redirecting to login action also. my goal is the users page should be reload or to be intimate that your session time out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.