How to html encode the output of an NHaml view (or any MVC view)?
- by jessegavin
I have several views written in NHaml that I would like to render as encoded html. Here's one.
%table.data
%thead
%tr
%th Country Name
%th ISO 2
%th ISO 3
%th ISO #
%tbody
- foreach(var c in ViewData.Model.Countries)
%tr
%td =c.Name
%td =c.Alpha2
%td =c.Alpha3
%td =c.Number
…