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.
MVC 4 ビューで DIV の ID タグを動的に生成したい:
<div id="newBox{0}"></div>
{0} を @Model.MyTag に置き換えます
そのためのベストプラクティスは何ですか?
<div id="newBox@(Model.MyTag)"></div>
また
<div id="newBox@{Write(Model.MyTag);}"></div>
どちらも HTML エンコーディングを行います (特殊文字は安全です)。