This is a migrated thread and some comments may be shown as answers.

[Solved] Ajax binding with MVC Authorise attribute

1 Answer 130 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
jmo
Top achievements
Rank 1
jmo asked on 02 Feb 2011, 01:27 PM
My MVC app requires the user to login, and I am using System.Web.MVC.Authorise attribute to control this.

In other words a security exception occurs if the user tries to access the Action when not logged in.

This appears to be an issue with the MVC grid and ajax binding, as I get a JSON error once the timeout of your session occurs.

To repo:
- secure an action your Ajax binding grid uses, using [Authorise]
- wait for timeout of your asp.net session
- click "edit" (for example), fill in the edit form, click Save button, and instead of getting logged out, as would happen on a normal browse to an Action/View, a pop up is displayed saying:
"Error!The requested URL did not return JSON"

Any ideas?

1 Answer, 1 is accepted

Sort by
0
jmo
Top achievements
Rank 1
answered on 17 Feb 2011, 02:54 PM
I found this link , which led me to the grid error event, and I customised from there to handle the timeout on an Ajax grid action.
Tags
Grid
Asked by
jmo
Top achievements
Rank 1
Answers by
jmo
Top achievements
Rank 1
Share this question
or