/// <summary> /// Save message into TempData /// </summary> /// <param name="type">Notification type</param> /// <param name="message">Message</param> /// <param name="encode">A value indicating whether the message should not be encoded</param> protected virtual void PrepareTempData(ENotifyType type, string message, bool encode = true) { var notificationMessages = new NotifyDataModel { Status = type, Message = message, HtmlEncoded = encode }; TempData["Notifications"] = JsonConvert.SerializeObject(notificationMessages); }
/// <summary> /// Display notification /// </summary> /// <param name="type">Notification type</param> /// <param name="message">Message</param> /// <param name="encode">A value indicating whether the message should not be encoded</param> public virtual void Notification(ENotifyType type, string message, bool encode = true) { PrepareTempData(type, message, encode); }