Search code examples
ajaxfirefoxupdatepanel

Update Panel in Firefox loading forever


I have 2 select controls. One change event updates the other. Also, it updates a grid inside update panel.

On page load, I call an ajax method to get the drop down values for both select. I populate the control and trigger a button click event which then updates the grid inside the update panel.

Everything works fine in all browsers, except in Firefox. Any idea as to why this might be happening?

Upon using break point i discovered that in other browsers the server side method is called first and then the ajax method while in Firefox its the other way around.

I narrowed down the issue to when using EndRequestHandler. I use EndRequestHandler event to change the class for a control. I remove that functionality and its perfect. The code for it is below:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); function EndRequestHandler() 
{ 
var type = $('[id$=ddlType]').val(); 
$('a[data-categoryid="' + type + '"').parent().addClass('selected');
 } 

Solution

  • Finally, there was a typo in my code. I forgot the closing square bracket in the EndRequestHandler. Surprisingly, the other browsers didn't care about it!

    Updated code.

    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); function EndRequestHandler() 
    { 
    var type = $('[id$=ddlType]').val(); 
    $('a[data-categoryid="' + type + '"]').parent().addClass('selected');
     }