We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dialog closing stop to work when calling Javascript

Thread ID:





147100 Sep 1,2019 07:58 PM UTC Sep 2,2019 03:02 PM UTC Blazor 3
Tags: Dialog
Asked On September 1, 2019 07:58 PM UTC


I found a strange behavior with the latest packages (.Net Core 3.0 preview 8, Syncfusion.EJs.Blazor with the dialog component.

I attached the sample that reproduce the issue. Just run it. If you click on the Open Dialog button, it works. Then you can click on Ok or Cancel button and dialog will close.
Now, stop the application. Uncomment the line 30 in Index.razor file

Line 30 : 
// await JSRuntime.InvokeAsync<object>("window.testCallJs.startCallJs");

Then run the app again. Click on the Open Dialog button. The dialog opens. But if you try to close it with Ok or Cancel button, it doesn't work.

If you take a look in the Index.razor file, you will see that I tried to use DialogEvents, but without any success.

This code worked when my application was running under .Net core 3.0 preview 7 and syncfusion

Best regards,

Attachment: BlazorApp1_6e6fd58.zip

Pandiyaraj Muniyandi [Syncfusion]
Replied On September 2, 2019 06:39 AM UTC

Hi Benoit, 
Greetings from Syncfusion support. 
We have validated the reported issue with the shared sample and able to reproduce from our end. The JSRuntime.InvokeAsync method call doesn’t stop without getting a result from the async method call, due to this further action not working in the sample. As per shared sample, startCallJS method not returns any value, so we suggest you change the open dialog button handler return type as void from Task as follows and check from your end. 
    private async void OnBtnClick() 
        await JSRuntime.InvokeAsync<object>("window.testCallJs.startCallJs"); 
We have modified your sample with above changes, get it from below link 
Pandiyaraj M 

Replied On September 2, 2019 02:29 PM UTC

Hi Pandiyaraj,

Thanks for your help. It works.


Pandiyaraj Muniyandi [Syncfusion]
Replied On September 2, 2019 03:02 PM UTC

Hi Benoit 
Most welcome!  
Pandiyaraj M 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon