title: Always output raw HTML using MVC3 and Razor
body: <p>I’ve got a class with a property that looks like this:</p>
  
  <pre><code>[AllowHtml]
  [DataType(DataType.MultilineText)]
  public string Description { get; set; }
  </code></pre>
  
  <p>I’ve already put in the <code>[AllowHtml]</code> attribute to let me submit HTML to this property via the form that I’ve built, but what I want to do is output the value of the property as the raw HTML without it being escaped.</p>
  
  <p>I know I can use <code>Html.Raw(Model.Description)</code> but what I’m looking for is some way of telling <code>Html.DisplayFor(m =&gt; m.Description)</code> to always output the raw HTML. Is there an attribute I can use to decorate the properties in my class that I wish to behave like that?</p>
  
  <p>Basically it’s me being lazy—I don’t want to have to remember which properties might contain HTML, so I don’t want to have to think about using <code>Html.Raw(…)</code> when I need to do the above—I’d much rather my Model know what it should do and do it automatically. I’ve tried searching for an answer, but either I’m not phrasing it correctly or there’s no way of doing it :(</p>
  
  <p>Thanks,</p>