This is the Code I’m having problems with:
@{int i = 1;}
@foreach (var item in Model)
{
@:<ul id="sortablei" class='droptrue'>
i++;
}
How can I use i in the id sortablei?
I tried: @i or @{i} but it seems without a space before the i its not working.
I couldn’t find an answer to my problem in the Razor Syntax Reference so I’m a bit clueless right now.
Brackets:
The brackets here scope the razor expression; in many cases they aren’t required, however they are necessary when:
abc@def– this has special handling to avoid breaking pages with email addresses in them