Hi,
Is there any way of getting the http error code when this result fires? In my application (asp.net mvc) I am returning a 403 Forbidden code when the forms authentication for the user times out.
In my other ajax calls to the app, the code is available and I am redirecting the users to the login page if appropriate. An example of this would be the ClientNodeDropping event
How can I achieve this with the OnClientNodePopulationFailed event?
Thanks,
Nick
Is there any way of getting the http error code when this result fires? In my application (asp.net mvc) I am returning a 403 Forbidden code when the forms authentication for the user times out.
In my other ajax calls to the app, the code is available and I am redirecting the users to the login page if appropriate. An example of this would be the ClientNodeDropping event
| //handles node dropping event. |
| function clientNodeDropping(sender, eventArgs) { |
| //Get source and destination nodes. |
| var srcNode = eventArgs.get_sourceNode(); |
| var destNode = eventArgs.get_destNode(); |
| //Get values needed to update a folder or reports location. |
| var srcId = srcNode.get_value(); |
| var srcType = srcNode.get_attributes().getAttribute("nodeType"); |
| var destId; |
| var destType; |
| try { |
| destId = destNode.get_value(); |
| destType = destNode.get_attributes().getAttribute("nodeType") |
| } |
| catch (e) { |
| destId = 0; |
| desttype = "Folder"; |
| } |
| //Check that destination node is not of "Report" nodeType. |
| if (destType != "Report") { |
| $.ajax({ |
| type: "POST", |
| url: "/Reports/MoveNode/", |
| data: ({ sourceId: srcId, destinationId: destId, srcNodeType: srcType, destNodeType: destType }), |
| dataType: "json", |
| success: function(response) { |
| if (response.Success) { |
| clientNodeDroppingSuccess(srcNode, destNode, srcType, destType); |
| } |
| else { |
| alert(response.Errors[0]); |
| eventArgs.set_cancel(true); |
| } |
| }, |
| error: function(xhr, state, errorThrown) { |
| switch (xhr.status) { |
| case 403: |
| window.location = window.location; |
| break; |
| default: |
| alert("Sorry, that action could not be performed at this time."); |
| eventArgs.set_cancel(true); |
| break; |
| } |
| } |
| }); |
| } |
| } |
How can I achieve this with the OnClientNodePopulationFailed event?
Thanks,
Nick