title: Correct use of @Html.Raw()
body: <p>I am trying to generate a view that has collapsing panels in it. I need each panel to have a unique ID. I have successfully done it with the code below. but was warned in a different post that using @Html.Raw() is bad practice.
  What is my alternative?</p>
  
  <pre><code> @Html.Raw("&lt;div id=\"collapse")@Html.DisplayFor(modelitem =&gt; item.NAME)@Html.Raw("\" class=\"panel-collapse collapse collapse\" role=\"tabpanel\" aria-labelledby=\"heading")@Html.DisplayFor(modelitem =&gt; item.NAME)@Html.Raw("\"&gt;")
  </code></pre>