This is a migrated thread and some comments may be shown as answers.
RadConfirm implementation in External js file
1 Answer 15 Views
This is a migrated thread and some comments may be shown as answers.
A2H
Top achievements
Rank 1
A2H asked on 02 Feb 2012, 04:56 AM
Hi,

I have a webpage in which javascript functionality was embedded in external js file.
Currently in external js file we have used ordinary confirm and i want to replace this with radconfirm.

I have used radconfirm on button click, where we have return false also with that. and then in javascript callback  we do a post back using 
"__dopostback() fuction.

I dont know how can i use this in external js file.

Current Scenario :
I am able to see radconfirm,but the execution is not stopping when we click on cancel.

Please help me.

Thanks,
A2H

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 03 Feb 2012, 04:31 PM
Hello,

Please examine this demo: http://demos.telerik.com/aspnet-ajax/window/examples/confirmserverclicks/defaultcs.aspx. You can see how it relies on passing a reference to the clicked button to its OnClientClicked handler so that it does not depend on the page's context. You can use this approach to externalize the confirmations. I also advise that you make sure you cancel the postback in the string that defines click handler itself, as returning false later in the JavaScript function may happen too late and thus - not work. The demo's description provides information on the logic of the approach, its peculiarities and limitations.


Regards,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Asked by
A2H
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or