# Display Multiline Text in a Predefined Alert

## Environment

<table>
    <tbody>
        <tr>
            <td>Product</td>
            <td>Dialog for Blazor</td>
        </tr>
        <tr>
            <td>Version</td>
            <td>15.0.1 and above</td>
        </tr>
    </tbody>
</table>

## Description

Display a multiline message in a predefined `AlertAsync` dialog.

## Solution

The `AlertAsync` method accepts a `string`. Use a verbatim string to include line breaks in the message. The `white-space: pre-line` rule preserves those line breaks in the predefined Alert.

```RAZOR
<style>
    .k-dialog.k-alert .k-messagebox {
        white-space: pre-line;
    }
</style>

@code {
    [CascadingParameter]
    public DialogFactory? Dialogs { get; set; }

    private async Task ShowMultilineAlert()
    {
        if (Dialogs is not null)
        {
            await Dialogs.AlertAsync(@"Something went wrong!
mammaggia");
        }
    }
}
```

For HTML or richer content, use the [`TelerikDialog` component](https://www.telerik.com/blazor-ui/documentation/components/dialog/overview) and place the content in `DialogContent`.

## See Also

* [Predefined Dialogs](https://www.telerik.com/blazor-ui/documentation/components/dialog/predefined)
* [Setting Width to Predefined Dialogs](https://www.telerik.com/blazor-ui/documentation/knowledge-base/dialog-dialogfactory-alert-confirm-prompt-width)
