[Resolved] Radzen Notification showing twice/ duplicates

Hi there,

I am using NotificationService.notify twice in my app, and each time the notification shows up twice. However, when debugging it is called only once? What could be the issue?

This is basically my code:

private async Task ShareViaEmail()
{
    try
    {
        var emailRequest = new EmailRequest
       {
                ToEmail = "...",
       };

        var uri = NavigationManager.ToAbsoluteUri($"api/upload/send-email");

        var response = await Http.PostAsJsonAsync(uri, emailRequest);
       response.EnsureSuccessStatusCode();

       AppInsights.TrackEvent(new EventTelemetry() { Name = "ShareViaEmail" });

        NotificationService.Notify(new NotificationMessage
        {
            Severity = NotificationSeverity.Success,
            Summary = "Email Sent",
            Detail = $"Email sent successfully to {emailRequest.ToEmail}. In some cases, you need to verify your spam folder.",
            Duration = 10000
        });
   }
   catch (Exception ex)
   {
       Console.WriteLine($"Error sharing via email: {ex.Message}");
   }

image

Check if you don’t have both RadzenNotification and RadzenComponents added to your layout.

1 Like

Very likely that you instantiating two times the radzen components.

Check if you use f.e. in your mainlayout and additionally on some page which you show inside.

1 Like

Wow you guys are amazing!

It was indeed RadzenComponents inside my MainLayout.razor

image

I commented it out and it resolved the duplicate Notifcations.

1 Like