This is a migrated thread and some comments may be shown as answers.

postback with radconfirm

1 Answer 105 Views
Window
This is a migrated thread and some comments may be shown as answers.
Anumeha
Top achievements
Rank 1
Anumeha asked on 13 Nov 2010, 12:36 AM
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.

1 Answer, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 15 Nov 2010, 04:44 PM
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.
Tags
Window
Asked by
Anumeha
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Share this question
or