This is a migrated thread and some comments may be shown as answers.

postback event aborting previous postback

4 Answers 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Barry McMillen
Top achievements
Rank 1
Barry McMillen asked on 27 Jul 2011, 09:11 PM

I have an ASP.NET web page with two postback events and the second one is aborting the first. The second one then doesn't render as expected once it completes.

In Detail

I have an ASP.NET web page that effectively contains two link buttons. It uses the Telerik ASP.NET AJAX controls, but I'm not sure if the behaviour is specfic to these controls:

The Page - an extremely cut-down version is as follows:

<telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" 
 
Position="BottomLeft" RelativeTo="Element" ShowEvent="OnClick"  
 
HideEvent="ManualClose" Animation="Fade" OnAjaxUpdate="OnShowItems" >   
     
<TargetControls> 
         
<telerik:ToolTipTargetControl TargetControlID="btnShowItems" /> 
     
</TargetControls> 
</telerik:RadToolTipManager> 
... 
... 
<asp:LinkButton ID="btnShowItems" runat="server" Visible="false"> 
     
<span><%= ItemsPrompt %></span> 
</asp:LinkButton> 
... 
... 
<uc1:X ID="XControl" runat="server"/>


The UserControl "X" - an extremely cut-down version is as follows:

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" 
 
LoadingPanelID="LoadingPanel1" RenderMode="Block"> 
   
<asp:LinkButton runat="server" ID="CausePostbackButton"  
     
Style="display: none" /> 
</telerik:RadAjaxPanel> 


Use Case #1 - successful

  1. The page loads and a JavaScript timer within Control "X" activates a postback on the LinkButton "CausePostbackButton" [eval(__doPostBack(postbackButtonClientID,''));]. (So, this mimics a user clicking the button).
  2. The AJAX call goes to the Server and n seconds later it returns and results in the page updating in a particular way.
  3. The user then clicks the LinkButton "btnShowItems" which causes a post-back to the Server and n' seconds later it returns and results in the page updating in a particular way.

Use Case #2 - failure

  1. The page loads and a JavaScript timer within Control "X" activates a postback on the LinkButton "CausePostbackButton". (So, this mimics a user clicking the button).

  2. Before the server has time to respond, the User clicks on the LinkButton "btnShowItems".

  3. In FireFox/Firebug, you can see that the first post-back event is "Aborted". The second post-back event completes (you can see the time taken reported) but the page is not visually updated.

  4. If the "manual" button is then clicked again, then that works as expected.

My thoughts

  • I know that JavaScript is single threaded, so if events can't be run immediately then they are queued.

  • I know that if a timer fires an event that is queued and then fires the same event whilst the first event is still queued, then one of these events (the second?) will be dropped.

  • This is acting as if the first event is being trashed, but then the second event can no longer find its "channel" to write to.

However, if I change the "manual" Link Button to an Image Button then the behaviour does not change.

Any ideas what the problem is (and ideally a solution)?

Many thanks in advance

Griff

submitted by bmcmillen

4 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 28 Jul 2011, 03:55 PM
Hello Barry,

By design ASP.NET AJAX Framework cancels the ongoing ajax request if you try to initiate another one prior to receiving the response from the first one. I would suggest you to set the RequestQueueSize for the RadAjaxPanel to 3 for example and test if this will fix the issue. Please review the following help topic which elaborates on this behaviour.

All the best,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Maria Ilieva
Telerik team
answered on 28 Jul 2011, 03:55 PM
Hello Barry,

By design ASP.NET AJAX Framework cancels the ongoing ajax request if you try to initiate another one prior to receiving the response from the first one. I would suggest you to set the RequestQueueSize for the RadAjaxPanel to 3 for example and test if this will fix the issue. Please review the following help topic which elaborates on this behaviour.

All the best,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Barry McMillen
Top achievements
Rank 1
answered on 01 Aug 2011, 03:21 PM
Hello Maria,
   That change did the job.

Thank you, Barry
0
Jayesh Goyani
Top achievements
Rank 2
answered on 01 Aug 2011, 06:06 PM
hi,

the solution given by Maria Ilieva is perfect.
but you can also set this property as shown in below.


<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" RequestQueueSize="50">

Thanks,
Jayesh Goyani
Tags
General Discussions
Asked by
Barry McMillen
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Barry McMillen
Top achievements
Rank 1
Jayesh Goyani
Top achievements
Rank 2
Share this question
or