title: convert model property value with javascript in razor
body: <p>i have a foreach to iterate through items in razor syntax,</p>
  
  <pre><code>@foreach (var item in Model)
  {
      &lt;tr&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.Name)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.ColorCode)
          &lt;/td&gt;
          &lt;td&gt;
  
  
              &lt;div style="background-color:*************"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
  
  
          &lt;/td&gt;
          &lt;td&gt;
              @Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
              @Html.ActionLink("Details", "Details", new { id = item.ID }) |
              @Html.ActionLink("Delete", "Delete", new { id = item.ID })
          &lt;/td&gt;
      &lt;/tr&gt;
  }
  </code></pre>
  
  <p>ColorCode is an int value
  ,i define an external function named IntToColorHex to convert ColorCode to equivalent hex value,i want to replace ************** with an hex color value for each row according to ColorCode,i need some thing like bellow:</p>
  
  <pre><code>&lt;div style="background-color:IntToColorHex(@item.ColorCode)"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
  </code></pre>