什么是最好的方式来处理这样的东西:
剃刀代码:
@if(!disableRowDiv) { <div class="row"> } <div>some content here</div> @if(!disableRowDiv) { </div> }
所以Razor引擎不会产生这个错误:
解析器错误消息:
The if block is missing a closing “}” character. Make sure you have a matching “}” character for all the “{” characters within this block,and that none of the “}” characters are being interpreted as markup.
解决方法
这应该工作
@if(!disableRowDiv) { @:<div class="row"> } <div>some content here</div> @if(!disableRowDiv) { @:</div> }