No need to just drop @ with @if and do this:
@foreach (var document in Model) { if (document.Item.Count > 0) { <div> @MvcHtmlString.Create(document.Items[0].ContentPresenter) </div> } }
Sorry I didnโt work with Razor, but is its selling point an automatic context-based switch between code and HTML?
Carson63000
source share