I've implemented a .NET Web control that uses the callback structure implemented in ASP.Net 2.0. It's an autodropdown control, and it works correctly in IE 6.0/7.0 and Google Chrome. Here's the relevant callback function:
function ReceiveServerData(args, context)
{
document.getElementById(context).style.zIndex = 300;
document.getElementById(context).style.visibility = 'visible';
document.getElementById(context).innerHTML = args;
fixHover(context);
}
In Firefox, "args" is always the same data, so the innerHTML of the <div>
that is the display for my dropdown always shows the same items. I've doublechecked my client-side code, and the right information is being sent client->server and in return server-> client.
Of note, in the "WebForm_DoCallback" function created by the .NET framework, the following snippet is getting called:
if (setRequestHeaderMethodExists) {
xmlRequest.onreadystatechange = WebForm_CallbackComplete;
callback.xmlRequest = xmlRequest;
xmlRequest.open("POST", theForm.action, true);
xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlRequest.send(postData);
return;
}
and the callback function ReceiveServerData is called both on xmlRequest.open("POST", theForm.action, true);
and xmlRequest.send(postData);
. I wonder if this is causing an error, but I'm at the end of my debugging skills.
Edited to add -- ReceiveServerData is not being called twice the very first time I use the dropdown -- in fact, the dropdown works correctly for the very first keystroke. It stops working, and doubles the callback with old return data, after the first keystroke.