I’m working on extending an existing ASP.NET MVC project, and there are some oddities in the Views. I’ve basically figured out the syntax and how to use it, but it’s nothing I’ve ever seen before, and I’m wondering if it’s from a special view engine or something else?
Here’s a sample section of code:
<table>
{{for Books}}
<tr>
<td>Title: {{:Title}}</td>
</tr>
{{/for}}
</table>
Note the : in the {{:Title}} reference.
And in this case, the model would look like this:
public class BooksModel
{
public List<Book> Books { get; set; }
}
public class Book
{
public string Title { get; set; }
public string Author { get; set; }
}
(obviously, this is only a simple example for demonstration purposes, not actual production code)
Note that there are other flow of control markup items as well, such as {{if}} and the corresponding {{/if}}, etc.
Is this just part of the base Razor syntax that I’ve never seen before, or is this part of a custom view engine?
Really, I just want to know where this came from, so I can see if there’s anything else I need to know about it.
Yes, it is for a client side templating engine (probably JsRender).