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

[Solved] Call code behind method from confirmation window

0 Answers 10 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nav
Top achievements
Rank 1
Nav asked on 22 Feb 2013, 10:53 AM
Hi I am trying to do following:

- On button click show Confirmation window
- If user select 'Yes' then call 'btnSendFiles_Click' Method in my page code behind
<asp:Button ID="btnSendFiles" Text="Send Files"  runat="server" Visible="true"
                            OnClientClick="JavaScript:SendConfirm();" />

function SendConfirm() {
                ConfirmMessage("Do you want to send the files?", "btnSendFiles_Click");
            }

function ConfirmMessage(messageText, callback) {

    yesCallback = callback;

    confirmDialog = $.telerik.window.create({
        title: "Info",
        html: "<center><div style='padding:10px'>" + messageText + "<br/><br/> \
                    <button style='margin:10px' onclick='javascript:yesCallback();confirmDialog.close();'>Yes</button> \
                    <button style='margin:10px' onclick='confirmDialog.close();'>No</button></div></center>",
        modal: true,
        resizable: false,
        draggable: true,
        visible: false,
        width: 300
    })
.data('tWindow').center().open();
}

It displays confirm window but not at center of screen and then throws error:
Microsoft JScript runtime error: Function expected

Any help??

Tags
Window
Asked by
Nav
Top achievements
Rank 1
Share this question
or