Пример #1
0
 public void ToastrWarning(string message, string title="",
   bool isSticky = false)
 {
     var toastMessage = new ToastMessage
     {
         AlertType = AlertType.Warning,
         IsSticky = isSticky,
         Message = message,
         Title = title
     };
     this.AddToastrAlert(toastMessage);
 }
Пример #2
0
 public ToastMessage AddToastMessage(ToastMessage toast)
 {
     ToastMessages.Add(toast);
     return toast;
 }
        public static void AddToastrAlert(this System.Web.Mvc.Controller controller, ToastMessage message)
        {
            var toastr = controller.TempData.ContainsKey(ToastMessage.TempDataKey)
                ? (Toastr)controller.TempData[ToastMessage.TempDataKey]
                : new Toastr();

            toastr.AddToastMessage(message);

            controller.TempData[ToastMessage.TempDataKey] = toastr;
        }