I have a telerik modal popup. In the popup there is a telerik radgrid. On clicking a button the below ajax gets called and the radgrid gets filled if data is returned.
<script type="text/javascript">
function OnSeriesClick(args) {
var kendoWidget = args.sender;
var operationCount = args.value;
var operationType = args.category;
var userName = document.getElementById("<%= ddlUsers.ClientID %>").value;
var startDate = document.getElementById("<%= RadDateTimePicker1.ClientID %>").value;
var endDate = document.getElementById("<%= RadDateTimePicker2.ClientID %>").value;
var jsonData = "{ 'OperationType':'" + operationType + "', 'UserName':'" + userName + "', 'StartDate':'" + startDate + "', 'EndDate':'" + endDate + "' }";
var GridData;
jQuery.ajax({
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: jsonData,
cache: false,
dataType: 'JSON',
url: 'ListView.aspx/GetFileNames',
success: function (result) {
GridData = result.d;
if (GridData.length > 0) {
var divGridContainer = document.getElementById('divGridContainer');
divGridContainer.style.display = "block";
var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
tableView.set_dataSource(GridData);
tableView.dataBind();
alert('grid filled');
}
else {
var divGridContainer = document.getElementById('divGridContainer');
divGridContainer.style.display = "none";
alert('grid not filled');
}
},
error: function () {
alert('Error on binding the data');
}
});
var oWnd = $find('<%= modalPopup.ClientID %>');
document.getElementById('<%= txtUser.ClientID %>').value = userName;
oWnd.show();
}
</script>
While in debug mode the the ajax call is getting success in all known browsers and the modal popup with filled grid data is showing.
After deploying the project in IIS 8 the ajax call is getting success in Chrome, Edge and FF browsers and the modal popup with filled grid data is showing but the grid is not getting filled in IE. In IE it is showing the alert('grid not filled').
I inspected the IE and saw that the ajax call is getting called and gives response of 200 but in if (GridData.length > 0) it is getting failed.
I don't know what to do as while debugging in IE its working fine but after deployment its not.
Any help is much appreciated. Thank you.
What I have tried:
I don't know what to try because I am facing this issue for the very first time. I searched a lot but every where people face this issue regarding CORS. But in my case its not CORS because the ajax is getting called from code behind page.