//Show the confirm, then when it is closing, if returned value was true, automatically call the caller's click method again.

var callBackFn = function (arg)

{

if (arg)

{

callerObj["onclick"] = "";

if (callerObj.click) callerObj.click(); //Works fine every time in IE, but does not work for links in Moz

elseif (callerObj.tagName == "A") //We assume it is a link button!

{

try

{

eval(callerObj.href)

}

catch(e){}

}

}

}

//We will need to modify the oldconfirm as well ????????

oldConfirm(text, callBackFn, oWidth, oHeight, callerObj, oTitle);

}

returnfalse;

}

}

I don't need this script on each page and I use a registerConfirm method in codebehind to insert it.
But this script should be called after RadWindowManager declaration, so I use following code to add it on the last instructions of the page:
string scrpt = "ConfirmLoadHandler();";
AjaxManager.ResponseScripts.Add(scrpt);

And I get problems on callback: I am fearing the radconfirm function is replaced many times ? How to control this.

Is there a more recent sample we could use with last 2.1001 version to have a safely confirm with radWindows.

Thanks for clarification.

CS

Georgi Tunev

The code that you posted (here is the original Code Library thread) hasn't been changed and is working for both RadWindow for ASP.NET and RadWindow for ASP.NET AJAX. If you still experience problems, please open a support ticket an send us a sample project where they can be reproduced - we will check it and do our best to help.

Best wishes,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Thanks for answer, I will take time to create a test project and submit it in a ticket, but my framework being linked to another huge product needding licenses and long install, it take much more time to do this, having to rewrite everything in a simulated way.
Myconstraints are that I am using a modular (acsx) architecture for pages, I have a RadWindowManager in the main page template(aspx) which loads dynamically modules. Each module need a way to confirm some buttn clicks.

If you could have first validated these options I have taken :
- using AjaxManager.ResponseScripts.Add(scrpt) in the page template on to install the alias for radconfirm in a way it always will appear after RadWindowManager declaration.
- using AjaxManager.ResponseScripts.Add(scrpt) on each call, callback or not (risk on aliasing multiple times ?), it seems that after an ajax callback generated by a control not using radconfirm, I loose the radConfirm handler ?
- should I include the radWindowManager as an updated control in RadAjaxManager ?

These small answer could help reducing 'my uncertain zone' directly without mounting a testbed.
Thanks for your time.

CS

Georgi Tunev

I am not familiar with your exact setup, so I cannot provide definitive answers to your questions, but in general RadWindowManager does not need to be updated if you are using only its client-side API. Also AjaxManager.ResponseScripts.Add() method will add a script to the collection and because RadAjaxManager will be created at the same time as the RadWindowManager, the script should work fine.

This being said, I suggest to try isolating the several setups that you have in your real-life project in a separate application. Just make sure that your logic work fine with a standard window.confirm() function and send us the application (please make sure that it can be run locally and is not missing files or database). We will check it and rework it for you so it uses radconfirm() instead of window.confirm().

Kind regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Do you know that thelink in emails you send are broken since new site? .... and the delete key is not working in this editor...

I finally succeded in having a general script working, using RadAjax.ResponseScript just on the non callback.
I also found some interesting problem for IE (have to check for otjher browsers): I was using an anchor with an img inside so when I was clicking on the img, the anchor onclick event is triggered but the event. srcElement is the IMG ???? soI add to adapt the script for this case, taking the parentNode as callerObj.

It is uneasy to extract testbed from my application environment as it depends of an external application, without this application testing could be of no interest.

Thanks for help, hope that Telerik will do a move to have a special confirm objet in some futur.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.