This project is read-only.

(bug) Everything gets encoded


It seems that everything that I try and add to the template gets encoded. How can I add html elements to the template the same kind of way that someone might do it via @Html.LabelFor(d => d.Id)?

My Template
public class MyTemplateBase : HtmlTemplateBase<Person>
    public string LabelFor(Expression<Func<Person, string>> ex)
        return "<label for=\"Id\">" + ex.Compile().Invoke(this.Model) + "</label>";
Output html AFTER rendering
<label for="Id">1</label>

Expected html
<label for="Id">1</label>

Razor View
        var html = Razor.Parse<Person>(@"
<!DOCTYPE html>

<head> <meta name=""viewport"" content=""width=device-width"" /> <title>Index</title> </head> <body>
   @LabelFor(d => d.Id)
        ", new Person() { Id = "1", Name = "Dude" });


DotNetRockStar wrote Mar 25, 2014 at 10:07 PM

btw. the "output html AFTER rendering" is the Html encoded value, not what it has up there (forum did that after I typed it)