I'm working on an MVC application that is utilising SignalR
The controller has...
'GET: Home/DiaryEntries
Function DiaryEntries(<DataSourceRequest> request As DataSourceRequest) As ActionResult
'get a list of all Headline diary entries
'removed for brevity... HLDiary list is an IQueryable(Of DiaryEntry)
'DiaryEntry is an object with 7 properies
Return Json(HLDiaryList, JsonRequestBehavior.AllowGet)
End Function
My Home/Index view has the following javascript
function outputHLDiaryEntries() {
$.getJSON("Home/DiaryEntries", function (json) {
var out = "";
var i;
for(i = 0; i < arr.length; i++) {
out += '<div class="dOuter"><div class="dRow1">';
out += '<div class="dDate">' + json.results[i].dDate + '</div>';
out += '<div class="dRef">' + json.results[i].dRef + '</div>';
out += '<div class="dTeam">' + json.results[i].dTeam + '</div>';
out += '<div class="dTeam">' + json.results[i].dCreatedBy + '</div>';
out += '<div class="' + json.results[i].dType + '">' + json.results[i].dType + '</div></div>';
out += '<div class="dServers">' + json.results[i].dServers + '</div>';
out += '<div class="dComment">' + htmlEncode(json.results[i].dComment) + '</div></div>';
}
$('#diaryTable').innerHTML = out;
});
}
Unfortunately when outputHLDiaryEntries() is called it returns a 500 error
- Name= http://localhost/UIS/Home/DiaryEntries
- Protocol=HTTP
- Method=GET
- Result=500
- Content type=text/html
- Received=7.36 KB
- Time=238.03 ms
- Initiator=XMLHttpRequest
and the error is
This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.
As you can see I've allowed Get Behaviour in my function...
Return Json(HLDiaryList, JsonRequestBehavior.AllowGet)
Why is this and how can I fix... I'm out of ideas