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

'event' is not defined

1 Answer 113 Views
Window
This is a migrated thread and some comments may be shown as answers.
Vincent
Top achievements
Rank 1
Vincent asked on 01 Jul 2010, 10:35 AM
I have copy the exact blockConfirm script in the demo, and try to use it in my custom dialog. it works fine if I put it in the button "OnClientClick" event directly.

here is my working code snippet

OnClientClick="return blockConfirm('The selected Dynamic Content will be deleted. Are you sure you would like to continue?', event, 450, 100,'','DELETE DYNAMIC CONTENT');" 



However, now I need to do ajax postback to do another check and alert before I show the confirm, I changed OnClientClick to call "DeleteDynamicContent" function, and I received 'event' is not defined error.

here is my new js

function DeleteDynamicContent(dynamicContentID) { 
 
        PageMethods.GetTotNoOfRules( 
            dynamicContentID, 
            Validate_OnSucceeded, Validate_OnFailed); 
        return false
    } 
 
    function Validate_OnSucceeded(result) { 
        if (result == true) { 
            radalert('<%= getHelpText("Delete Dynamic Content Alert", "1a") %>', 450, 100, "DELETE DYNAMIC CONTENT"); 
            return
        } 
        else { 
            return blockConfirm('The selected Dynamic Content will be deleted. Are you sure you would like to continue?', event, 450, 100, '''DELETE DYNAMIC CONTENT'); 
        } 
 
    } 
 
    function Validate_OnFailed(error) { 
        alert(error);         
    } 



Please help!

Thanks

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 01 Jul 2010, 01:37 PM
Hi Vincent,

The "blocking confirm" code is considered a hack and we don't guarantee that it will work in all scenarios. I would suggest to consider changing your code logic and to use ajaxRequestWithTarget() instead as shown in this post.

Sincerely yours,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Window
Asked by
Vincent
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or