I know it's simple and I am probably missing something...Assume I want to give IDs to generated controls, when my model is a list of integers:
@model List<Int>
...
foreach(int number in Model)
{
<div id="box + @number"></div>
}
...
box + @number actually gives me : id="box + 1", "box + 2", etc. When I want : "box1", "box2". What am I doing wrong?
try:
<div id="@("box"+number)"></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With