Developer forum

Forum » Development » Add an alert in custom back-end pages

Add an alert in custom back-end pages

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,
I am trying to add some logic in some screens of a custom DW10 App.
I am trying to get to something like this:

More specifically, inject an Alert above the first element of the page.
Is this something already wired in the existing logic?

Thank you,
Adrian


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Adrian,
if you have some custom implemented list screen inherited from the ListScreenBase<T> class then you can override the GetAlert method to show the alert on your page:
protected override CoreUI.Displays.Information.Alert? GetAlert()
{
    if (_showAlert)
        return new CoreUI.Displays.Information.Alert
        {
            Type = CoreUI.Displays.Information.AlertType.Warning,
            Value = "Alert text"
        };
    return null;
}
BR, Dmitrij

 

You must be logged in to post in the forum