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

Loading panel not disappears on client button.click

2 Answers 184 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Damien
Top achievements
Rank 1
Damien asked on 21 Dec 2012, 04:12 PM
Hello,

I have a page with a RadAjaxPanel linked to a RadAjaxLoadingPanel.
In this page, via a user control, I have a text box and a search button. When the character 13 (CR) is pressed in the text box, the client side executes a click of the button.

<div style="margin:4px">
                  <asp:TextBox ID="TextBox1" runat="server"  EnableViewState="true" CssClass="BlackStandard"    />
              <asp:TextBox ID="TextBox2" runat="server" style="visibility:hidden;display:none;" /><%-- Necessary hidden textbox to link search button with enter on text box 1 --%>
              <asp:Button ID="btnSearch" Text="<%$ Resources:btnSearch %>" onclientclick="setCursorHourglass();" CssClass="CTAButton" runat="server"  OnClick="btnSearch_OnClick" />
          </div>

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
         <script type="text/javascript">
 
             ////////////////////////////////////////////////////////////////////
             // Make the click of the button in parameter when ENTER is typed
             // in the textbox in parameter
             function button_click(objTextBox, objBtnID) {
                 if (window.event.keyCode == 13) {
                     document.getElementById(objBtnID).focus();
                     document.getElementById(objBtnID).click();
                 }
             }
 
         </script>
     </telerik:RadCodeBlock>

protected void Page_Load(object sender, EventArgs e)
       {
 
           this.TextBox1.Attributes.Add("onkeypress", "button_click(this,'" + this.btnSearch.ClientID + "')");
          }

The click is well taken into account but the problem is that the loading panel appears BUT not disappears.
note that if I click manually on the button, the behaviour is correct (loading panel appears/disappears).

Someone has an idea of what freezes the loading panel ?

Thanks by advance.

Damien


2 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 24 Dec 2012, 01:17 PM
Hello Damien,

You need to use the $find() method to get hold of the client-component of the loading panel object and then hide it explicitly. Please, take a look at the following online example and the related help topic:
http://demos.telerik.com/aspnet-ajax/ajax/examples/loadingpanel/explicitshowhide/defaultcs.aspx

Regards,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Damien
Top achievements
Rank 1
answered on 03 Jan 2013, 01:41 PM
Hello Pavlina,

As you suggested, I hide explicitly the loading panel on the ResponseEnd event (the demo uses a RadAjaxManager, I use a RadAjaxPanel, so I use the ClientEvents-OnResponseEnd attribute of the RadAjaxPanel) and it now works correctly.

Thank you very much.

Regards,
Damien

Tags
Ajax
Asked by
Damien
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Damien
Top achievements
Rank 1
Share this question
or