mvc格式读取问题
如下代码:
<ul class="imagebg" id="imagebg">
@{
foreach (Attachment u in (IList<Attachment>)ViewData["ReturnList"])
{
<li data-sPic='@{@u.URL}'><a href="javascript:void(0)" class="bannerbg_main" style='background:url(@{@u.URL}) 50% 50% no-repeat;' ></a></li>
}
}
</ul>
我要@{@u.URL}在这个读取之前加上: @Url.Content(@{@u.URL}),该怎么写?谢谢.
[解决办法]
@Url.Content(u.URL)
[解决办法]
"<li data-sPic='@Url.Content(" + u.URL + "}),'><a href="javascript:void(0)" class="bannerbg_main" style='background:url(@Url.Content(" + u.URL + "}) 50% 50% no-repeat;' ></a></li>"