RadConfirm implementation in External js file

2 posts, 0 answers
  1. A2H
    A2H avatar
    177 posts
    Member since:
    Mar 2010

    Posted 01 Feb 2012 Link to this post

    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
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4529 posts

    Posted 03 Feb 2012 Link to this post

    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
Back to Top