Ejemplo n.º 1
0
        /// <summary>
        /// Renders any queued flash messages to and returns the html code.
        /// </summary>
        /// <param name="html"></param>
        /// <returns></returns>
        public static IHtmlContent RenderFlashMessages(this IHtmlHelper html)
        {
            // Retrieve queued messages.
            var messages = FlashMessage.Retrieve(html.TempData);
            var output   = "";

            foreach (var message in messages)
            {
                output += RenderFlashMessage(message);
            }

            return(new HtmlString(output));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Renders any queued flash messages to and returns the html code.
        /// </summary>
        /// <param name="html"></param>
        /// <returns></returns>
        public static IHtmlString RenderFlashMessages(this HtmlHelper html)
        {
            // Retrieve queued messages.
            var messages = FlashMessage.Retrieve(html.ViewContext.HttpContext);
            var output   = "";

            foreach (var message in messages)
            {
                output += RenderFlashMessage(message);
            }

            return(html.Raw(output));
        }