I'm posting to an ActionMethod to retrieve some customer counts. The post works fine from my local machine. When deployed to another server its throwing 404 errors. My post is below. I'm not sure why this has stopped working.
var urlStr = "/Items/ItemCount/";
jQuery.ajax({
type: 'POST',
dataType: 'json',
url: urlStr,
async: false, //wait on the result to be returned...
success: function (DocData) {
window.currentCount = DocData[0];
window.maximumAllowed = DocData[1];
},
cache: false,
error: function (request, status, error) {
alert(request.responseText);
}
});
<HttpPost()> _
Function ItemCount() As JsonResult
Dim Items As List(Of MyItems) = GetItems()
Dim Total As Integer = Items .Count
Dim Max = 5
Dim Data As New ArrayList
Data.Add(TotalDocs)
Data.Add(MaxDocs)
Return Json(Data)
End Function