C#Razor语法-html.display用于显示为文本,而不是html

C#Razor语法-html.display用于显示为文本,而不是html,c#,asp.net-mvc,linq-to-sql,razor,C#,Asp.net Mvc,Linq To Sql,Razor,我的模型: public class htmlDump { public string html { get; set; } } public string getSquares() { var sq = (from s in n.squares where s.active == true orderby s.date_created descending

我的模型:

    public class htmlDump {
        public string html { get; set; }
    }

    public string getSquares() {
        var sq = (from s in n.squares
                  where s.active == true
                 orderby s.date_created descending
                 select s.html).First();
        return sq;
    }
我的控制器:

    public ActionResult index() {
        intranetGS.htmlDump sq = new intranetGS.htmlDump {
            html = g.getSquares()
        };

        return View(sq);
    }
我的看法是:

 @Html.DisplayFor(model => model.html)
我想要的只是将传递给视图的html呈现为html而不是文本。当然,我可以在视图中使用一些不同的东西(而不是.DisplayFor)来工作。有什么建议吗

非常感谢

@Html.Raw(Model.html)

注意:如果此数据可以由用户输入-请确保已清理。

对于html使用
@html.Raw
由@neoistheone回答我尝试过,但我得到的是:无法将lambda表达式转换为type object,因为它不是委托typePerfect-感觉我应该知道这一点。谢谢