Problem using LoadingPanel on button with client script

2 posts, 0 answers
  1. Connie
    Connie avatar
    3 posts
    Member since:
    Jul 2010

    Posted 29 Jul 2010 Link to this post

    I have a RadGrid and a button that loads the grid based on a search string, and use the loading panel when the user hits the search button. I have a javascript function validate() on the button to validate if use enters search criteria, if I remove this javascript function from the button, the loading panel works fine. But if I add this function nothing happens when clicking search button even though the function return true.

    the code is as below:
    function validate() {
            if (document.getElementById("<%=txtQueryText.ClientID%>").value == "") {
                alert("Please enter search keyword!");
                document.getElementById("<%=txtQueryText.ClientID%>").focus();
                return false;
            }
            else return true;
        }
      
      
    <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="BtnSearch">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGridResults" LoadingPanelID="RadAjaxLoadingPanel1"/>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
    <asp:Button ID="btnSearch" runat="server" Text="<%$ Resources:GUI,Button.Search %>" OnClick="btnSearch_Click"  OnClientClick="return validate()" />


    Does it support client script button or what could be wrong.

    Please help. Thanks.
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 03 Aug 2010 Link to this post

    Hello Connie,

    I would suggest you to refer to the help topic below. It elaborates on executing custom javascript after ajax request:
    http://www.telerik.com/help/aspnet-ajax/ajxcustomjavascript.html

    Best wishes,
    Maria Ilieva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top