ASP.NET Repeater Template, Conditional Code for every Nth element

后端 未结 4 870
梦毁少年i
梦毁少年i 2021-02-13 13:34

I\'m using an asp.net repeater to create a bunch of images. The image markup is all the same so the standard is fine.

However, I want

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-13 14:03

    This should work for you, with no need for anything in the code behind (other than binding the repeater..):

    
    
    <%# (Container.ItemIndex != 0 && Container.ItemIndex % 5 == 0) ? @"
    " : string.Empty %>

提交回复
热议问题