Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

Notifications.cshtml

@using Newtonsoft.Json
@using Nop.Services.Messages
@{
    //Get messages from TempData
    var notes = TempData.ContainsKey(NopMessageDefaults.NotificationListKey)
        ? JsonConvert.DeserializeObject>(TempData[NopMessageDefaults.NotificationListKey].ToString())
        : null;
    if (notes != null)
    {
        foreach (var note in notes)
        {
            var cssStyle = "";
            switch (note.Type)
            {
                case NotifyType.Success:
                    cssStyle = "alert-success";
                    break;
                case NotifyType.Error:
                    cssStyle = "alert-danger";
                    break;
                case NotifyType.Warning:
                    cssStyle = "alert-warning";
                    break;
            }
            
@if (note.Encode) { @note.Message } else { @Html.Raw(note.Message) }
} } }