0
我是ASP.MVC4中Razor语法的新手,需要在循环中格式化字符串以提供正确图像文件的运行时路径。Razor语法For Each with String.Format
我在格式化For Each列表项中的字符串时遇到问题。你能看看下面,让我知道我错过了什么。
<ul class="column">
@For Each item As modeltype In Model
@<li>
@Code
dim itemImage as string = String.Format("../../Images/{0}.png", @item.MajorAssembly)
End Code
<a href="#"><img src="@itemImage"/></a>
</li>
Next
</ul>
这是代码示例纠正它看起来畸形 – 2012-07-30 09:05:12