postback with radconfirm

2 posts, 0 answers
  1. Anumeha
    Anumeha avatar
    36 posts
    Member since:
    Aug 2010

    Posted 12 Nov 2010 Link to this post

    Hi,

    I am trying to display a confirmation box and based on the result I need to do further processing.
    Currently, I am using a windows confirm and everything runs fine. I am not able to achieve the same functionality with a radconfirm. Can you assist?

    On click of a button I am running this code:
    Private Sub ConfirmUpdate(ByVal confirmText As String)
      
            Dim sb As StringBuilder = New StringBuilder()
            sb.Append("<script type='text/javascript'>")
            sb.Append("ConfirmUpdate('" + confirmText + "');")
            sb.Append("</script>")
      
            RadAjaxManager1.ResponseScripts.Add(sb.ToString())
      
        End Sub

    In the js I do this:
    function ConfirmUpdate(confirmText, action) {
                if (confirm(confirmText)) {
                    document.getElementById('<%= btnUpdate.ClientID %>').click();
                }
            }

    I get js errors when i try the same with radconfirm.
    I need to change the style and the confirm button text so I want to use radconfirm. I read somewhere that if(confirm) kind of scenario is not possible with the blocking execution thread functionality of radconfirm.
    I am using VB.NET

    Please advice.
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 15 Nov 2010 Link to this post

    Hello Anumeha,

    The RadConfirm dialog requires a callback function to be defined, as you'll see in the online demos. Thus the reason you get javascript errors. In the callback you would place the code that clicks the button.

    Online Demo: http://demos.telerik.com/aspnet-ajax/window/examples/browserdialogboxes/defaultcs.aspx

    I hope that helps.
Back to Top