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

OnclientClick executes and then Page is Postback

1 Answer 81 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Hiren
Top achievements
Rank 1
Hiren asked on 01 Feb 2013, 11:49 AM

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?




1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 06 Feb 2013, 07:33 AM
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.
Tags
Editor
Asked by
Hiren
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or