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

Problem using LoadingPanel on button with client script

1 Answer 57 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Connie
Top achievements
Rank 1
Connie asked on 29 Jul 2010, 08:21 PM
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.

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 03 Aug 2010, 12:18 PM
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
Tags
Ajax
Asked by
Connie
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or