Skip to content

Commit fd301a3

Browse files
Add UI alerts to layout to show alerts on UI fixed #263
1 parent 5a397d3 commit fd301a3

File tree

1 file changed

+18
-0
lines changed
  • aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Shared

1 file changed

+18
-0
lines changed

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Shared/_Layout.cshtml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@using System.Globalization
22
@using Abp.Configuration
33
@using Abp.Configuration.Startup
4+
@using Abp.Web.Mvc.Alerts
45
@using Abp.Web.Security.AntiForgery
56
@using AbpCompanyName.AbpProjectName
67
@using AbpCompanyName.AbpProjectName.Configuration
@@ -15,6 +16,7 @@
1516
@inject IMultiTenancyConfig MultiTenancyConfig
1617
@inject IWebResourceManager WebResourceManager
1718
@inject ISettingManager SettingManager
19+
@inject IAlertManager AlertManager
1820
@{
1921
Layout = null;
2022
AbpAntiForgeryManager.SetCookie(Context);
@@ -143,6 +145,22 @@
143145

144146
<section class="content">
145147
<div class="container-fluid">
148+
@if (AlertManager.Alerts.Any())
149+
{
150+
<div id="AbpPageAlerts">
151+
@foreach (var alertMessage in AlertManager.Alerts)
152+
{
153+
<div class="alert [email protected]().ToLower() @(alertMessage.Dismissible ? "alert-dismisable" : "")" role="alert">
154+
@if (alertMessage.Dismissible)
155+
{
156+
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
157+
}
158+
<strong>@alertMessage.Title</strong> @alertMessage.Text
159+
</div>
160+
}
161+
</div>
162+
}
163+
146164
@RenderBody()
147165
</div>
148166
</section>

0 commit comments

Comments
 (0)