I need to change the CSS class of the tag with the \'forumChild\' class. It has to change every 3 loops of the foreach loop. Is there a way
tag with the \'forumChild\' class. It has to change every 3 loops of the foreach loop. Is there a way
Is there a way
You can add a counter variable to will start with 1 and increment in loop. Check with if statement is true by % and change the class name
@{ int counter = 1;} @foreach (var item in Model) { if( (counter % 3) ==0 ) { } else { } i++; 0 讨论(0) 查看其它4个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复