ASP.NET MVC Razor Concatenation January 5, 2023 by Tarik You should wrap the inner part of the call with ( ): <li id="item_@(item.TheItemId)">