asp.net mvc 页面内容呈现Html.Raw
Html.Raw内容经过页面呈现,不呈现Html标签
@Html.Raw( File.ReadAllText(Server.MapPath("~/Content/html/about.html")))
HtmlString内容不经过页面处理呈现,原样呈现,含Html标签
@(File.ReadAllText(Server.MapPath("~/Content/html/about.html"))) 或 @( new HtmlString(File.ReadAllText(Server.MapPath("~/Content/html/about.html"))))
时间: 2024-10-02 13:56:58