Set up to reproduce:
<telerik:RadToggleButton ID="RadToggleButton1" runat="server" Text="RadToggleButton">
<ConfirmSettings ConfirmText="Sure?" />
<ToggleStates>
<telerik:ButtonToggleState Text="state1">
<Icon Url="supervisorIcon.png" />
</telerik:ButtonToggleState>
<telerik:ButtonToggleState Text="state2">
<Icon Url="ownerIcon.jfif" />
</telerik:ButtonToggleState>
</ToggleStates>
</telerik:RadToggleButton>
As a workaround you can validate the action manually by canceling the On:
<script>
function clientClicking(sender, args) {
args.set_cancel(!window.confirm("Sure?"));
}
</script>
<telerik:RadToggleButton ID="RadToggleButton1" runat="server" Text="RadToggleButton" OnClientClicking="clientClicking">
<ToggleStates>
<telerik:ButtonToggleState Text="state1">
<Icon Url="supervisorIcon.png" />
</telerik:ButtonToggleState>
<telerik:ButtonToggleState Text="state2">
<Icon Url="ownerIcon.jfif" />
</telerik:ButtonToggleState>
</ToggleStates>
</telerik:RadToggleButton>
<script>
var preventCommand = true;
var button;
function clientClicking(sender, args) {
button = sender;
if (preventCommand) {
args.set_cancel(preventCommand);
radconfirm("Sure?", confirmCallBackFn, 300, 200, null, "Confirm");
}
}
function confirmCallBackFn(arg) {
if (arg) {
preventCommand = false;
button.click();
}
}
</script>
<telerik:RadWindowManager runat="server" ID="RadWindowManager"></telerik:RadWindowManager>
<telerik:RadToggleButton ID="RadToggleButton1" runat="server" Text="RadToggleButton" OnClientClicking="clientClicking">
<ToggleStates>
<telerik:ButtonToggleState Text="state1">
<Icon Url="supervisorIcon.png" />
</telerik:ButtonToggleState>
<telerik:ButtonToggleState Text="state2">
<Icon Url="ownerIcon.jfif" />
</telerik:ButtonToggleState>
</ToggleStates>
</telerik:RadToggleButton>