views:

371

answers:

1

I'm having the same problem I had yesterday... The solution Aristos provided helped solve the problem, but I have other places sending updatepanel postbacks causing the same problem.

When an update panel is updated and another request for an update is called before it has a chance to render the first updates, the entire page refreshes instead of just the update panel.

I used fiddler to see what was going on and here's what happens... If I wait for the request to return before doing another request I get this:

21443|updatePanel|dnn_ctr1107_CRM_SalesTool_LeadsUpdatePanel|

But if I don't wait, I get this:

66|pageRedirect||http://mysite.com/salesdashboard.aspx|

The code from the previous question is still the same except I added UpdateMode="Conditional" to the update panel.

Any ideas? Or is the only solution to this making sure that 2+ updates for any number of update panels (as long as they're on the same page) never happen?

Thanks,
Matt

A: 

Dear Matt.

Maybe microsoft automatic ajax can not handle 2 request at the same time because he needs to know what is the post back every time, so probably if you click when he wait for a return, then he knows that the post back, has change, so he by pass ajax to be soure for correct return.

I can think 2 ways. One way is to make it by your self using jQuery and ajax and avoid UpdatePanel.

Second way, is to block the clicks when you wait for the return, or make a mechanism to place the request, the one after the other.

This code can help you know when you block the input and when you release it, or do what ever you think.

$(document).ready(function() {
    var prm = Sys.WebForms.PageRequestManager.getInstance();

    prm.add_initializeRequest(InitializeRequest);
    prm.add_endRequest(EndRequest);
});

function InitializeRequest(sender, args) {  
   LastIdCaller = args.get_postBackElement().id;    
}

function EndRequest(sender, args) {
}
Aristos