Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Can anyone tell me why the code below will not work? I am getting an error. I want to wrap the carousel item with the beginning and ending tags if certain conditions are met.
foreach(var item in Umbraco.Content(1287).Children()) { count++; @count if(count ==1){ <div class="item active"> <div class="row"> } <div class="col-md-3"><a href="#" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" style="max-width:100%;"></a></div> if(count ==4){ </div> </div> } }
Hi
The problem is that Razor doesn't understand unclosed html tags, try this code:
foreach(var item in Umbraco.Content(1287).Children()) { count++; @count if(count ==1){ @:<div class="item active"> @:<div class="row"> } <div class="col-md-3"><a href="#" class="thumbnail"><img src="http://placehold.it/250x250" alt="Image" style="max-width:100%;"></a></div> if(count ==4){ @:</div> @:</div> } }
Thanks,
ALex
Hi Mov3nforward
Did you solve the issue? Share with our community, please )
Alex
Alex,
Yes, thanks.
-Lee
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Issue with for loop
Can anyone tell me why the code below will not work? I am getting an error. I want to wrap the carousel item with the beginning and ending tags if certain conditions are met.
Hi
The problem is that Razor doesn't understand unclosed html tags, try this code:
Thanks,
ALex
Hi Mov3nforward
Did you solve the issue? Share with our community, please )
Thanks,
Alex
Alex,
Yes, thanks.
-Lee
is working on a reply...