Join text + variable in Razor
Try the following:
@for(int i=0;i<5;i++)
{
<input type="text" value="@(i)" id = "name_@(i)"/>
}
When you're having trouble getting Razor to understand your intent, use parenthesis around your expression to create an "Explicit Expression."