コード例 #1
0
 public static IHtmlString PageMessage(this HtmlHelper helper, PageMessageModel message)
 {
     if (message != null)
     {
         return(helper.Raw(message.ToString()));
     }
     else
     {
         return(new MvcHtmlString(""));
     }
 }
コード例 #2
0
        public static IHtmlString PageMessageFor <TModel, TProperty>(this HtmlHelper <TModel> helper, Expression <Func <TModel, TProperty> > expression)
            where TModel : BaseViewModel
            where TProperty : PageMessageModel
        {
            if (helper.ViewData.Model == null)
            {
                return(new MvcHtmlString(""));
            }

            PageMessageModel model = expression.Compile()(helper.ViewData.Model);

            return(helper.PageMessage(model));
        }
コード例 #3
0
 public virtual ActionResult RedirectToActionWithMessage(ActionResult redirectAction, PageMessageModel model)
 {
     SetTempDataPageMessage(model);
     return(RedirectToRoute(redirectAction.GetT4MVCResult().RouteValueDictionary));
 }
コード例 #4
0
 protected void SetTempDataPageMessage(PageMessageModel model)
 {
     TempData[TempData_PageMessage] = model;
 }
コード例 #5
0
 protected ActionResult PageMessage(PageMessageModel messageModel)
 {
     return(PartialView(MVC.Shared.Views.Partials._PageMessage, messageModel));
 }