Quantcast
Channel: RazorGenerator Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 525

Edited Issue: Provide a way to clear a RazorTemplateBase's _generatingEnvironment [91]

$
0
0
I want to be able to use a template in a loop, like so:<br /><br /> @{ var fooView = new FooView(); } <!-- FooView is a compiled template that outputs a li --><br /> <ul><br /> @foreach (var foo in foos) {<br /> @{<br /> fooView.Clear(); <br /> fooView.Foo = foo;<br /> }<br /> @fooView.TransformText()<br /> }<br /> </ul><br /><br />The lack of a `Clear()` method means that each time I call `TransformText()` the internal `StringBuilder` (`_generatingEnvironment`) just keeps appending new `<li>`s.

Viewing all articles
Browse latest Browse all 525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>