something like that:
@model System.Generic.Collections.List<MyNameSpace.Product> @{ int i = 1; string sortablei = "abc", droptrue = "abc-cls"; } <ul id="@sortablei" class="@droptrue"> @foreach (var item in Model) { <li>@item.Qty x @item.Name</li> i++; } </ul>
Here is a short link for your knowledge.
Stitches like me didn’t understand
as Mark said, all you have to do is surround the variable with brackets like
sortable@ (i)
I hope this link is somewhat useful, as your specific problem can be found in Explicit expression example
source share