0

我正在使用 asp.net Postal 使用后台作业发送电子邮件 - 准确地说是 Hangfire。

在我的模板中,我有以下代码:

@Html.Raw(Model.Post.PostContent)

但我收到以下错误:

 The name 'Html' does not exist in the current context

下面是完整的模板:

视图/电子邮件/Example.cshtml

@model ExampleEmail
To: @Model.To
From: @Model.From
Subject: @Model.Subject
Views: Text, Html

视图/电子邮件/Example.Html.cshtml

Content-Type: text/html; charset=utf-8

<html>
 <body>
    <p>@Html.Raw(Model.Post.PostContent)</p>
 </body>
</html>

我怎样才能解决这个问题?

4

1 回答 1

0

使用@Raw(Model.Post.PostContent)似乎有效

于 2018-02-21T13:04:55.943 回答