【问题标题】:MvcMailer Areas and _Layout IssueMvcMailer 区域和 _Layout 问题
【发布时间】:2016-11-17 08:29:24
【问题描述】:

我在我的项目中使用MvcMailer 发送电子邮件。

一切正常,但是当我在管理区域发送电子邮件时,电子邮件以管理区域布局发送,并且不使用“~/View/UserMailer/_Layout.cshtml”。

在这个项目的 Github 中,some one discuss this issue 但没有人不回答。

有人知道吗?

【问题讨论】:

    标签: asp.net-mvc layout sendmail area mvcmailer


    【解决方案1】:

    将邮件文件夹中的 _Layout.cshtml 重命名为其他名称,例如 _LayoutMailer.cshtml

    将UserMailer.cs 中的邮件构造函数中的 MasterName 重命名为:

    public class UserMailer : MailerBase
    {
        public UserMailer()
        {
            MasterName = "_LayoutMailer";
        }
        ...
    }
    

    【讨论】:

      猜你喜欢
      • 2012-05-17
      • 1970-01-01
      • 1970-01-01
      • 2018-10-12
      • 1970-01-01
      • 2013-02-07
      • 2012-08-03
      • 2020-04-09
      • 1970-01-01
      相关资源
      最近更新 更多