Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MVC Razor syntax: @ followed by HTML
- @Html.Tmpl(@<p>text to display</p>)
- public static HelperResult Tmpl<TModel>( this HtmlHelper<TModel> html, Func<HtmlHelper<TModel>, HelperResult> template )
- {
- return new HelperResult( writer => template( html ).WriteTo( writer ) );
- }
- public static HelperResult List<T>(this IEnumerable<T> items,
- Func<T, HelperResult> template) {
- return new HelperResult(writer => {
- foreach (var item in items) {
- template(item).WriteTo(writer);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment