Create Modal Dialogue in the View?

Dear Radzen Team,

I am looking at the Radzen library and it looks really powerful. However, I've run into a small problem and I'm hoping someone here can help me.

I need a modal window. I see that in Radzen this is the dialogue component. Unfortunately, all the examples are constructed in such a way that the modal window opens in the codebehind.

Is it possible to place a modal window in the view in Radzen? This would have the advantage that modal windows that are used more often in a project can also be outsourced as a Razor component. The way Radzen Dialog is implemented now, you can't do that because the HTML code is in the codebehind.

Thanks
daniel

EDIT

To prevent confusion about MODAL: A modal window is a term from the Windows platform and refers to a window that is placed in the foreground, where all windows in the background remain inactive as long as the modal window is open.

How this looks in the web world can be seen here: How To Make a Modal Box With CSS and JavaScript

The first example uses a component for the dialog content (DialogCardPage in this case):

        await DialogService.OpenAsync<DialogCardPage>($"Order {orderID}",
               new Dictionary<string, object>() { { "OrderID", orderID } },
               new DialogOptions() { Width = "700px", Height = "512px", Resizable = true, Draggable = true });

Fine :slight_smile:

And DialogCardPage is a Razor Page that I created and can call up like that?

Thank you Atanas

Yes, it is defined here: radzen-blazor/DialogCardPage.razor at master ยท radzenhq/radzen-blazor ยท GitHub

1 Like