This question is locked. New answers and comments are not allowed.
Hi there,
I have a page which contains a grid control using custom binding. The page requires authorization. After the user's session timeout, if the user clicks the refresh button or changes pages, the returned ajax response will be the html of the Sign In page. That is because the controller tries to redirect the user to there. In this case, a javascript error will happen because the response data cannot be parsed.
I added the try catch code to telerik.grid.js:
success: $.proxy(function(data) {
try {
data = eval("(" + data + ")");
}
catch (err) {
$t.trigger(this.element, 'error', { errorMsg: "invalid data" });
return;
}
...
The OnError event will be triggered and I can assume that the 'invalid data' error is due to session timeout.
It would be better if you guys come up with a better solution in the next release so that I don't have to add my patch again.
Regards,
Richard
I have a page which contains a grid control using custom binding. The page requires authorization. After the user's session timeout, if the user clicks the refresh button or changes pages, the returned ajax response will be the html of the Sign In page. That is because the controller tries to redirect the user to there. In this case, a javascript error will happen because the response data cannot be parsed.
I added the try catch code to telerik.grid.js:
success: $.proxy(function(data) {
try {
data = eval("(" + data + ")");
}
catch (err) {
$t.trigger(this.element, 'error', { errorMsg: "invalid data" });
return;
}
...
The OnError event will be triggered and I can assume that the 'invalid data' error is due to session timeout.
It would be better if you guys come up with a better solution in the next release so that I don't have to add my patch again.
Regards,
Richard