Skip to main content
All docs
V24.1

ToastOptions.Id Property

Specifies the toast’s unique identifier.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public string Id { get; set; }

Property Value

Type Description
String

A string that identifies the component.

Remarks

<DxButton Text="Show a toast" Click="AddToast" />
<DxButton Text="Hide a toast" Click="HideToast" />
<DxToastProvider DisplayTime="@TimeSpan.Zero" />
@code {
    [Inject] IToastNotificationService ToastService { get; set; }

    private void AddToast() {
        ToastService.ShowToast(new ToastOptions {
            Id = "TaskNotification",
            Title = "Notification",
            Text = "The process is completed.",
        });
    }
    private void HideToast() {
        ToastService.CloseToast("TaskNotification");
    }
}
See Also