I have an ASP.NET webpage with two postback events, and the second interrupts the first. The second - when it completes, it does not appear as expected.
In detail
I have an ASP.NET webpage that has two link buttons. It uses AJAX Telerik ASP.NET controls, but I'm not sure if the behavior is specific to these controls:
Page - an extremely abridged 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"/>
UserControl "X" - an extremely abridged 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 No. 1 - Successfully
- The page load and JavaScript timer in the "X" control activates the postback to LinkButton "CausePostbackButton" [eval (__ doPostBack (postbackButtonClientID, ''));]. (Thus, it mimics the user by pressing a button).
- The AJAX call goes to the server, and after a few seconds it returns and causes the page to refresh in a certain way.
- Then the user clicks the link "btnShowItems" LinkButton, which causes feedback to the server, and after "seconds" it returns and causes the page to refresh in a certain way.
Use Case No. 2 - Failure
The page load and JavaScript timer in the "X" control activates the postback to LinkButton "CausePostbackButton". (Thus, it mimics the user by pressing a button).
Before the server can respond, the user clicks on the link "btnShowItems" LinkButton.
In FireFox / Firebug you can see that the first event after the feedback is βCanceledβ. The second event ends after completion (you can see the time that was reported), but the page is not visually updated.
If the βmanualβ button is pressed again, then this works as expected.
My thoughts
I know that JavaScript is single-threaded, so if events cannot be triggered immediately, they are queued.
I know that if the timer fires an event in the queue and then fires the same event while the first event is still queued, then one of these events (the second?) Will be deleted.
It acts as if the first event is breaking, but then the second event can no longer find its "channel" for recording.
However, if I changed the "manual" Link button to the Image button, the behavior will not change.
Any ideas what the problem is (and ideally a solution)?
Thank you very much in advance
Griff
source share