DxMessageBox.ChildContent Property
Specifies custom content displayed in the message box body.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v26.1.dll
Declaration
[Parameter]
public RenderFragment ChildContent { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment | Content markup. |
Remarks
Use the ChildContent property to display custom Razor markup in the message box body instead of plain text. When ChildContent is set, the DxMessageBox component ignores the Text property value.
The following code snippet uses ChildContent to add formatted text to the message box body:
<DxButton Text="Show Message Box" Click="@(() => MessageBoxVisible = true)" />
<DxMessageBox @bind-Visible="MessageBoxVisible" Title="Update Available!">
<ChildContent>
<p>Version <b>26.1</b> is ready for download.</p>
<p>
Explore the latest features and bug fixes in our
<a href="https://www.devexpress.com/subscriptions/whats-new/" target="_blank">Release Notes</a>.
</p>
</ChildContent>
</DxMessageBox>
@code {
bool MessageBoxVisible { get; set; } = false;
}
To display custom content in a message box created by the dialog service, pass a RenderFragment to the AlertAsync(MessageBoxOptions, RenderFragment) or ConfirmAsync(MessageBoxOptions, RenderFragment) method.
Note
Since ChildContent contains nested markup of its parent class, the template content must conform to HTML semantics.