Radconfirm return values

4 posts, 1 answers
  1. Mark
    Mark avatar
    36 posts
    Member since:
    Mar 2014

    Posted 04 Jul 2014 Link to this post

    Hello Forum

    Is there at way to retrieve clickresult from Radconfirm from within a javascriptfunction.

    This might be a trivial question, im not sure, I have been starring me blind on solving this. :)

    Here goes my last shot that didnt work, any hints are welcome:

     function MainFn() {

                 var answer= confirmFn("OK CANCEL ?");              
                  alert(answer);
                  if (answer==false)
                      return false;  //Break here    
                   
                   //else  do something more....

                   // return an end result
                  return false;
                         
              } 


     function confirmFn(text) {
                  var callBackFn = function (arg) {
                      if (arg) {                      
                          return true;
                      }
                      else {
                          return false;
                      }

                  }
                  radconfirm(text, callBackFn);
              } 



             
  2. Mark
    Mark avatar
    36 posts
    Member since:
    Mar 2014

    Posted 04 Jul 2014 Link to this post

    To clarify; this is what i am looking for, only with use of radconfirm :

    function MainFn() {

               
                      if (confirm("OK CANCEL?") == false)
                      { return true; }   
                                          
                   //else  do something more....

                   // return an end result
                  return false;
                         
              } 
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Jul 2014 in reply to Mark Link to this post

    Hi Mark,

    Please try to use the RadConfirm to achieve your scenario. Here is the sample code snippet which works fine at my end.

    JavaScript:
    function pageLoad() {
        radconfirm("OK CANCEL?", callBackFunction, 500, 500, null, "Confirm");
    }
    function callBackFunction(args) {
        if (args == true) {
            //your code
        }
    }

    Please elaborate your requirement if it doesn't help.
    Thanks,
    Shinu.
  5. Mark
    Mark avatar
    36 posts
    Member since:
    Mar 2014

    Posted 07 Jul 2014 Link to this post

    Thanks for your input Shinu

    Im sorry I forgot to mention that the radconfirm is supposed to break a buttons postback by returning "false" ;

     <asp:Button ID="Button1" OnClientClick="MainFn"  OnClick="Button1_Click" runat="server" Text="Button" />

    I have  found this to work:

     function MainFn(sender, args) {
                
                       var callBackFunction = Function.createDelegate(sender, function (shouldSubmit) {
                           if (shouldSubmit) {
                               alert("Do something more..then postback");
                               this.click();
                           } 
                        else {
                               alert("cancel selected. do nothing..");
                           }
                       });
                       var text = "Are you sure you want to submit the page?";
                       radconfirm(text, callBackFunction, 300, 160, null, "RadConfirm");
                       args.set_cancel(true);  // postback(radbutton) stopped
                   }
                 









Back to Top