My .ashx Handler called from a jQuery AJAX post occasionally does not receive form elements in the HttpContext.Request.
When this happens, the Request contains either only ViewState elements or has no elements at all.
It has failed OCCASIONALLY only with IE7, IE8, and IE9 (with several thousand hits/day by various browsers). I cannot reproduce this myself using IE and 'most' IE users (and all other users) do not experience this problem.
Javascript:
var data = $('form').serializeArray();
$.ajax({
type: "POST",
async: false,
dataType: "text",
url: "handler.ashx",
data: data
});
C# (handler.ashx):
void IHttpHandler.ProcessRequest(HttpContext context) {
var collection = SetCollection(context.Request);
// collection sometimes has just ViewState elements;
// sometimes it has no items
}
private NameValueCollection SetCollection(HttpRequest request){
return request.Form;
}
Other info: The site is part of a web farm with a load balancer. Using .net 3.5. I read that IE has a different way of generating the request header; not sure if this is related.
Thank you for any insight to resolving my problem.