Hi Radzen-Team,
Is it possible to use the dialogue component directly within the Razor Page? The way it is solved now in Radzen, you have to take a long way round and integrate an external page as a dialogue. The biggest problem is the data flow to and from the dialogue.
This picture shows what I mean by this:
This is an Ant component called MODAL, which represents a dialogue. This component is implemented in such a way that dialogue can be switched on and off within the Razor page via a flag (see Visible on pic.). However, because this component is located on the Razor page, the data flow is easy (Dialog has access to all variables and objects in the Razor page or codebehind).
Thanks
perfect-code
Hi @perfect-code,
At the moment this isn't possible. You can use the inline content definition as a workaround:
async Task ShowInlineDialog()
{
var result = await DialogService.OpenAsync("Simple Dialog", ds =>
@<RadzenStack Gap="1.5rem">
<p>Confirm Order ID <b>@orderID</b>?</p>
<RadzenStack Orientation="Orientation.Horizontal" Gap="0.5rem" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.SpaceBetween">
<RadzenStack Orientation="Orientation.Horizontal">
<RadzenButton Text="Ok" Click="() => ds.Close(true)" Style="width: 80px;" />
<RadzenButton Text="Cancel" Click="() => ds.Close(false)" ButtonStyle="ButtonStyle.Light" />
</RadzenStack>
<RadzenButton Text="Refresh" Click="(() => { orderID = 10249; ds.Refresh(); })" ButtonStyle="ButtonStyle.Light" />
</RadzenStack>
</RadzenStack>);
}
Having said that we will probably implement something similar in one of our future releases.
1 Like