我需要<div>
使用“forumChild”类更改标签的 CSS 类。它必须改变 foreach 循环的每 3 个循环。
有没有办法从控件中做到这一点?
<div class="Forum">
<p>The Forum</p>
@foreach (var item in Model)
{
<div class="ForumChild">
<img src="@item.Blog.Image.img_path" alt="Not Found" />
<br />
@foreach (var comment in item.Blog.comment)
{
var db = new ACapture.Models.ACaptureDB();
var Name = from p in db.Profile.AsEnumerable()
where (p.AccountID == comment.AccountID)
select p;
<section>
<div>
<a href="@Url.Action("Index", "Home")">@foreach (var y in Name)
{ @(y.FirstName + " " + y.LastName + ":");
}</a>
</div>
<div>
@comment.Commentation
</div>
</section>
}
</div>
}
</div>
提前致谢