title: <script> tags inside an <asp:repeater>
body: <p>I'm outputting a few lines of Javascript within a Repeater control on an ASPX page. I want to use a value from my DataSource inside the script tag.</p>
  
  <p>A very basic example might be:</p>
  
  <pre><code>&lt;asp:Repeater ID="RepeaterBlah" runat="server"&gt;
   &lt;ItemTemplate&gt;
     Hello &lt;%# DataBinder.Eval(Container.DataItem, "SomeName")%&gt;
     &lt;script&gt;myfunction(&lt;%# DataBinder.Eval(Container.DataItem, "SomeNumber")%&gt;)&lt;/script&gt;
   &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>I'm aware that most people won't repeat script tags like this, but I am using a small snippet of code from a third-party that you can place anywhere on a page to create a Flash object. You pass it a number so it knows which image gallery to display. No problems using several on one page.</p>
  
  <p>To begin with, this worked fine, although I noticed the colours in Visual Web Developer indicated that it didn't really like the <code>&lt;%#</code> being used inside a <code>&lt;script&gt;</code> tag. Intellisense was going a bit nuts in the code-behind too!</p>
  
  <p>So what is the correct way to pass Dataset items into a script tag?</p>