title: Passing Repeater Container.ItemIndex to a Javascript function
body: <p>In C# Asp.Net I need to pass my repeater occurrence index into a Javascript function when <code>OnClientClick</code> is depressed from an ASP button. Here is my code</p>
  
  <pre><code>&lt;asp:Button ID="btnGetNewQuote" 
              Text="Get New Quote" 
              class="pcbutton" 
              runat="server" 
              OnCommand="GetNewQuote" 
              CommandArgument ='&lt;%# Container.ItemIndex %&gt;'  
              OnClientClick="return getNewQuote(&lt;%# Container.ItemIndex %&gt;) /&gt;
  </code></pre>
  
  <p>If I hard code ....OnClientClick="return getNewQuote(0)"> it works and the JS gets invoked, but as soon as I put the # Container.ItemIndex # in there the JS gets overlooked and it just posts back to the code behind...</p>
  
  <p>Passing the <code>Container.ItemIndex</code> into JS Functions works every where else on the page except this <code>OnClientClick</code> ?</p>
  
  <p>does anyone know why this is and what I can do to get around it?</p>