title: Chart.js . ASP . Legend Template
body: <p>I have looked everywhere for an answer to this. More than likely, it is something so simple and stupid that most people wouldn't run into it. I am very new to using JavaScript/JQuery, and primarily work in .NET ... specifically C# and Web Apps. </p>
  
  <p>My question is as follows.</p>
  
  <p>I am using Chart.js to draw a Donut chart in my ASP web application. Everything works fine. but when I go to set the options for the Legend, it will not recognize a few values, I'm assuming are defined in Chart.js file.</p>
  
  <pre><code>name.toLowerCase()
  </code></pre>
  
  <blockquote>
    <p>segements.length.. ect. . . It states "Unknown entity"</p>
  </blockquote>
  
  <p>Here is the line:</p>
  
  <pre><code>legendTemplate: &lt;%=name.toLowerCase()%&gt;-legend\"&gt;&lt;% for (var i=0; i&lt;segments.length; i++){%&gt;&lt;li&gt;&lt;span style=\"background-color:&lt;%=segments[i].fillColor%&gt;\"&gt;&lt;/span&gt;&lt;%if(segments[i].label){%&gt;&lt;%=segments[i].label%&gt;&lt;%}%&gt;&lt;/li&gt;&lt;%}%&gt;&lt;/ul&gt;" 
  </code></pre>
  
  <p>Note : When I use a standard HTML file, this works fine.</p>
  
  <p>I'm assuming it's because of the '&lt;%' need to be escaped or something, due to them being used in server-side code-behind.</p>
  
  <p>Any help would be greatly appreciated. </p>