@model Tishansoft.Model.Block @{ var BlockList = ViewBag.BLockList as IEnumerable<Tishansoft.Model.Block>; var six_blocks=BlockList.Where(x=>x.BlockTypeId==3); Decimal count=six_blocks.Count(); int list=Convert.ToInt16(Math.Ceiling(count/6)); int j = 6; int y = 1; } @foreach (var blocktype in BlockList.Where(x => x.BlockId != null)) { if (blocktype.BlockTypeId == 3) { <div class="recent-work clearfix bottom-2"> <div class="slidewrap1" > <div class="sixteen columns"> <h3 class="title bottom-2">Recent Work</h3> </div> <ul class="slider" id="sliderName1"> @for (int i = 0; i < list; i++) { <li class="slide"> @foreach (var item in six_blocks.Where(x => x.BlockId <= j&&x.BlockId>=y)) { <!-- item --> <div class="one-third column item"> <a href="@item.BlockURL.ToString()"> <img src="../Content/images/portfolio/@item.BlockImage.ToString()" alt="" class="pic" /> <div class="img-caption"> <div class="desc"><h3>@item.BlockTitle</h3><p>@item.BlockContent</p><span>+</span></div> </div><!-- hover effect --> </a> </div> <!-- End --> } @j=@j+6; @y=@y+6; </li> } </ul> </div> </div> } }
@j=@j+6; @y=@y+6;
@{ j=j+6; y=y+6;}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)