Razor View Syntax doesn't recognize the “@” in an HTML attribute
问题 I am migrating a project from MVC 2 to MVC3 and the razor view engine. In MVC 2, I would have the following html: <div id="del_<%= Model.ActivityID.ToString() %>"></div> When using razor, I tried the following, which renders the literal text "del_@Model.ActivityID.ToString()" when I want del_1. <div id="del_@Model.ActivityID.ToString()"></div> To get around the issue, I used: <div id="@Model.ActivityID.ToString()_del"></div> Is there away to make razor work with this syntax? <div id="del_