Hello there,
I have a listbox inside a RadToolBar as below I want to do something only if the user confirms to do it, otherwise I want to just cancel.
What I need (Is there an example for this?):
1. Ideally I would like to use a RadWindow.Confirm to get a response and process based on Confirm or Cancel (popup using client script only).
2. I don't want a postback to happen if the user selects cancel on the popup.
(with the below code the postback happens even if args.set_cancel(result) and result is the Cancel response from the window.confirm) Is it because one of the container of the listbox is causing the postback?
Can you please help?
Thank you,
Manas
I have a listbox inside a RadToolBar as below I want to do something only if the user confirms to do it, otherwise I want to just cancel.
What I need (Is there an example for this?):
1. Ideally I would like to use a RadWindow.Confirm to get a response and process based on Confirm or Cancel (popup using client script only).
2. I don't want a postback to happen if the user selects cancel on the popup.
(with the below code the postback happens even if args.set_cancel(result) and result is the Cancel response from the window.confirm) Is it because one of the container of the listbox is causing the postback?
Can you please help?
<
telerik:RadToolBar
runat
=
"server"
ID
=
"RadToolBar1"
Width
=
"100%"
Skin
=
"Windows7"
>
<
Items
>
<
telerik:RadToolBarDropDown
ImageUrl
=
"~/app_themes/default/images/Check.png"
>
<
Buttons
>
<
telerik:RadToolBarButton
>
<
ItemTemplate
>
<
telerik:RadListBox
runat
=
"server"
ID
=
"lbDoSomething"
Skin
=
"Windows7"
SelectionMode
=
"Single"
OnClientSelectedIndexChanging
=
"ConfirmDo"
OnSelectedIndexChanged
=
"lbDoSomething_OnSelectedIndexChanged"
AutoPostBack
=
"True"
/>
</
ItemTemplate
>
</
telerik:RadToolBarButton
>
</
Buttons
>
</
telerik:RadToolBarDropDown
>
</
Items
>
</
telerik:RadToolBar
>
<
script
type
=
"text/javascript"
>
....
function ConfirmOverride(sender, args) {
var msg = "Are you sure you want to do something?";
var result = !window.confirm(msg);
args.set_cancel(result);
}
</
script
>
Thank you,
Manas