Telerik UI for ASP.NET AJAX

This topic shows how to prevent a specific button from performing postback. There are two ways to achieve this.

You can set the PostBack property to false for the item for which you want to prevent postback:

CopyASPX
<items>        
    <telerik:RadToolBarButton runat="server" Text="Button A">        
    </telerik:RadToolBarButton>        
    <telerik:RadToolBarButton runat="server" PostBack="false" Text="Button B (no postback)">        
    </telerik:RadToolBarButton>        
    <telerik:RadToolBarButton runat="server" Text="Button C">        
    </telerik:RadToolBarButton>    
</items>

Or, you can cancel the OnClientButtonClicking event for the specific item:

CopyASPX
<telerik:radtoolbar id="RadToolbar1" runat="server" onbuttonclick="RadToolbar1_ButtonClick"
    onclientbuttonclicking="OnClientButtonClickingHandler">       
    <Items>            
        <telerik:RadToolBarButton runat="server" Text="Button A">            
        </telerik:RadToolBarButton>            
        <telerik:RadToolBarButton runat="server" Value="noPostback" Text="Button B (no postback)">            
        </telerik:RadToolBarButton>            
        <telerik:RadToolBarButton runat="server" Text="Button C">            
        </telerik:RadToolBarButton>        
    </Items>    
    </telerik:radtoolbar>

<script type="text/javascript">
    function OnClientButtonClickingHandler(sender, eventArgs) {
        if (eventArgs.get_item().get_value() == "noPostback") {
            eventArgs.set_cancel(true);
        }
    }    
 </script>

See Also