OnclientClick executes and then Page is Postback

2 posts, 0 answers
  1. Hiren
    Hiren avatar
    2 posts
    Member since:
    Feb 2013

    Posted 01 Feb 2013 Link to this post


    I am working with the RadButton inside the User Control...

    <telerik:RadButton ID="tbnCancel"
                       runat="server"
                       Text="Cancel"
                       OnClientClicked="CloseEditFormTodoList" >
    </telerik:RadButton>

    And I am Calling javascript Function for Closing User Control


    function CloseEditFormTodoList(sender, eventArgs) {
    
        var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
        masterTable.cancelAll();
        return false;
    }

    My User Control was Closed But the Page is postback.

    How to avoid Postback?




  2. Slav
    Admin
    Slav avatar
    1359 posts

    Posted 06 Feb 2013 Link to this post

    Hello Hiren,

    You need to set the AutoPostBack property of RadButton to false so that no postback is performed when the control is clicked:
    <telerik:RadButton ID="tbnCancel"
                       runat="server"
                       Text="Cancel"
                       OnClientClicked="CloseEditFormTodoList"
                       AutoPostBack="false">
    </telerik:RadButton>

    Greetings,
    Slav
    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.
Back to Top