Hi,
I'm working on a template for Live Visualizer. I'm trying to dynamically wrap some html, similar to this example, https://stackoverflow.com/questions/46019375/asp-net-razor-dynamically-wrapping-ever-6-elements-in-bootstrap-rows
It seems that the Razor engine doesn't support the @: syntax. I tried doing a very basic test of just
@:This is some content
to see if it would out the text as content, but it didn't seem to work. Is this something that's supported in the Razor engine?
Thanks!
You don't need the @:
Any text you include in the template will be shown as conent. Here's an example based on your link:
@if(Model.Recipes_CanAdd) { <div class="lv-add-content mrg-bottom"> <a class="lvadd ms-btn ms-btn-primary" onclick="@Model.Recipes_Add()"><em class="ms-glyphicon ms-glyphicon-plus-sign"></em> </a> </div> <hr/> }
Thanks for the example. I see what I was doing wrong. In my specific template my if statement was incorrect. For the string comparison i was using single quotes instead of double quotes so if(Model.Carousel_Settings_Submission["Carousel Width"] != '12') should have really been if(Model.Carousel_Settings_Submission["Carousel Width"] != "12")
Your browser doesn't have Flash, Silverlight or HTML5 support.