Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我想遍历一些带有 div1,div2,div3,div4 等 id 的 html div,以便在 asp.net 项目中对它们进行更改。我想使用增量变量作为 id names 。我怎样才能做到这一点?
代码示例:
div1.InnerHtml = $"<h1 class=\"cName\">{cat}</h1>";
我想使用变量而不是 div1