Mar 13, 2015, 12:36 PM
[CLOSED] Window() failureHandler to catch unauthorized load url call
I have a window:
From another controller method I return:
But the unauthorized is not.
Please help.
@(Html.X().Window()
.ID("EditSalesRecordWindow")
.Icon(Icon.ApplicationViewDetail)
.Hidden(true)
.Height(600)
.Width(1000)
.Layout(LayoutType.Fit)
.Loader(Html.X().ComponentLoader()
.AutoLoad(false)
.Failure("failureHandlerfunction")
.Mode(LoadMode.Html)
.Scripts(true)
.LoadMask(mask => mask.ShowMask = true)
.Params(new
{
containerId = "EditSalesRecordWindow"
})
)
)
And a function that calls this window and loads a url into it:var openEditCustomerWindow = function (recordId, title, callurl) {
App.EditSalesRecordWindow.removeAll();
App.EditSalesRecordWindow.setTitle(title);
App.EditSalesRecordWindow.show();
App.EditSalesRecordWindow.load({
url: callurl,
params: {
id: recordId
}
});
App.EditSalesRecordWindow.failureHandler("failureHandlerfunction");
};
var failureHandlerfunction = function (error, response) {
if (response.status == 401) {
Ext.Msg.alert('Error', response.statusText);
}
if (response.status == 416) {
Ext.Msg.alert('Error', response.statusText);
}
};
When the session is expired, this call to load a url should be caught by the failureHandler function. But it is not.From another controller method I return:
Request.RequestContext.HttpContext.Response.StatusCode = 416;
return this.Direct();
And this is caught by the failureHandler function. But the unauthorized is not.
Please help.
Last edited by Daniil; Mar 20, 2015 at 11:52 AM.
Reason: [CLOSED]