You're trying to treat the radconfirm in the same way as a plain javascript confirm(), this isn't done in a like-for-like manner. I'll start with the Confirmation function.
function Confirmation(sender, args) {
debugger;
// The line below will open a rad confirmation window, it will not wait for the response
radconfirm('Are you sure you want to delete this file?', confirmCallBackFn);
}
To ensure that it doesn't automatically post back the above function should be changed as follows:
function Confirmation(sender, args) {
debugger;
// This line will open a rad confirmation window, it will not wait for the response
radconfirm('Are you sure you want to delete this file?', confirmCallBackFn);
// The line below will prevent the control from automatically posting back
return false;
}
The next step is correcting the call back function; The parameter passed into the function, as can be seen from the code rather than the parameter name is the boolean representation of the result from the confirmation box.
function confirmCallBackFn(sender) {
debugger;
if (sender)
flag = true;
else
flag = false;
return flag;
}
The previously written function returns a value, but this isn't used anywhere. The following code will perform the required action
function confirmCallBackFn(arg) {
debugger;
if (arg) {
// The line below will perform a post back, you might want to trigger this a different way
__doPostBack(sender.id, "");
}
}
Unfortunately as the sender is not passed into the callback function it is necessary to declare the function within the other JavaScript function as follows:
function Confirmation(sender) {
debugger;
// The callback function
function confirmCallBackFn(arg) {
debugger;
if (arg) {
// Triggers postback only when confirmation box returns true
__doPostBack(sender.id, "");
}
}
// This line will open a rad confirmation window, it will not wait for the response
radconfirm('Are you sure you want to delete this file?', confirmCallBackFn);
return false;
}
You might find the following link useful in regards to using the radconfirm in the same way as a confirm:
http://demos.telerik.com/aspnet-ajax/window/examples/confirmserverclicks/defaultcs.aspx.