This question is locked. New answers and comments are not allowed.
I am using MVC 2012.1.214 controls. I am trying to use the Splitter control with 2 panels. The left panel displays a PanelBar control and the right panel is populated by the Select function of what is chosen in the panel bar.
Here is the code that is invoked when an item in the panel bar is selected.
All works well as long as the url is correct that has been set on the data_url property of the menubar. However I have also added authentication to the methods using the [Authorize(Roles="role1")]. If I am presented with a menu option that would cause me to hit a method I am not authorized for my cursor just sits there spinning. So my question is is there a way to capture the exception processing when using ajaxRequest as noted above or is there an alternative way to achieve error handling? Below is an example of how jquery request handles the error processing however I am not sure how to handle that with ajaxRequest and the MVC library.
Here is the code that is invoked when an item in the panel bar is selected.
function Select(e) {
//get the clicked item and its Url set as an HTML Attribute
var item = $(e.item);
var url = item.data("url");
//get a reference to the splitter and load the corresponding content in the second pane
splitter = $("#Splitter");
if (splitter[0] && url) {
splitter.data("tSplitter").ajaxRequest(splitter.find(".t-pane")[1], url);
}
}
All works well as long as the url is correct that has been set on the data_url property of the menubar. However I have also added authentication to the methods using the [Authorize(Roles="role1")]. If I am presented with a menu option that would cause me to hit a method I am not authorized for my cursor just sits there spinning. So my question is is there a way to capture the exception processing when using ajaxRequest as noted above or is there an alternative way to achieve error handling? Below is an example of how jquery request handles the error processing however I am not sure how to handle that with ajaxRequest and the MVC library.
$.ajax({
url: url,
success: function (data) {
successcodehere
},
error: function (data) {
errorcodehere
}
});