/// <summary> /// Adds a message to the user's user message alerts (top) /// </summary> /// <param name="controller"></param> /// <param name="title"></param> /// <param name="message"></param> /// <param name="userMessageType"></param> public static void AddUserMessage(this System.Web.Mvc.TempDataDictionary tempData, string title, string message, UserMessageType userMessageType) { if (!tempData.ContainsKey("UserMessages")) { tempData.Add("UserMessages", new List <UserMessage>()); } List <UserMessage> userMessages = (List <UserMessage>)tempData["UserMessages"]; userMessages.Add(new UserMessage(title, message, userMessageType)); }
internal static void Set(System.Web.Mvc.TempDataDictionary tempData, string v) { tempData.Remove("message"); tempData.Add(key: "message", value: v); }