Cannot get the Dialog to appear using DialogService

This project was made with Visual Studio (2026) Blazor Web App template.
Target: .NET 10.0

Radzen.Blazor NuGet version: 9.0.5

Setup:
Added following to _Imports.razor
@using Radzen
@using Radzen.Blazor

And the changes to App.razor

<RadzenTheme Theme="material" />
  <script src="_content/Radzen.Blazor/Radzen.Blazor.js?v=@(typeof(Radzen.Colors).Assembly.GetName().Version)"></script>

And Program.c
builder.Services.AddRadzenComponents();

On the Home page I added the code for Radzen Dialog - Alert Dialog section
alert-dialog

But the issue is that no Dialog ever appears. The Radzen buttons are all there but nothing happens.

And I also added this to top of Home page.
@rendermode InteractiveServer

And put the project into github

What am I missing?

Thanks in advance

Make sure RadzenDialog is part of your layout.

1 Like

Hi @SkippyV

Paste the following into MainLayout.razor

@inherits LayoutComponentBase

<div class="page">
    <div class="sidebar">
        <NavMenu />
    </div>

<main>
    <div class="top-row px-4">
        <a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
    </div>

    <article class="content px-4">
        @Body
    </article>
</main>

</div>

@================ ADD THIS LINE =================@

<RadzenComponents @rendermode="InteractiveServer" />

@================ ADD THIS LINE =================@

<div id="blazor-error-ui" data-nosnippet>
    An unhandled error has occurred.
    <a href="." class="reload">Reload</a>
    <span class="dismiss">🗙</span>
</div>


Regards

Paul

1 Like

Thanks @enchev and @Paul_Ruston. Either approach was my missing piece.

So to just clarify for others who might be in my same learning phase:
I could have just added <RadzenDialog></RadzenDialog> to the markup portion of Home.razor where I was testing this component. Which makes sense, since that would declare an instance of the class RadzenDialog in that page.

But Paul's approach with adding <RadzenComponents @rendermode="InteractiveServer" /> confuses me on how it works - since there is no specific RadzenDialog reference in that snippet. Still learning but I'll get there.

Thanks again for all the help on this forum! You contributors show much more patience than I typically see in other forums.

Hi @SkippyV

The code below is the complete listing for the RadzenComponents component. It basically does what @enchev had already stated for RadzenDialog, but also ensures that the other UI elements are registered on the page.

<RadzenDialog @attributes="Attributes" />
<RadzenNotification @attributes="Attributes" />
<RadzenContextMenu @attributes="Attributes" />
<RadzenTooltip @attributes="Attributes" />
<RadzenChartTooltip @attributes="Attributes" />

@code {
/// 
/// Specifies additional custom attributes that will be rendered by the component.
/// 
/// The attributes.
[Parameter(CaptureUnmatchedValues = true)]
public IReadOnlyDictionary<string, object>? Attributes { get; set; }
}

Further reading / study

Radzen Blazor on github

You can either clone or download the complete source for the Radzen components from the above link. This, in itself, can be a great help in understanding how the library hangs together.

Many regards

Paul