title: Calling a javascript function with parameter bound to repeater
body: <p>I'm trying to call a javascript function.</p>
  
  <pre><code>function callSubClass(SubClassName) {
    ...
  }
  </code></pre>
  
  <p>But I am trying to call it inside a repeater where the parameter "SubClassName" is a string bound to my repeater.</p>
  
  <pre><code>&lt;asp:Repeater ID="rptSubClass" runat="server"&gt;
    &lt;ItemTemplate&gt;
      &lt;asp:LinkButton Text='&lt;%# Eval("SubClassName") %&gt;' runat="server" ID="linkHomeItem" OnClick='&lt;%# callSubClass(Eval("SubClassName")); return false; %&gt;'/&gt;
      &lt;br /&gt;
    &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>But every time I run it I get a compiler error saying:</p>
  
  <blockquote>
    <p>CS1040: Preprocessor directives must appear as the first non-whitespace character on a line Error</p>
  </blockquote>
  
  <p>Now I know the error is on the OnClick='stuff' but I've tried all I could think of to make it work. Here's a list of what I tried so far.</p>
  
  <pre><code>OnClick='&lt;%# callSubClass(Eval("SubClassName")); return false; %&gt;'
  OnClick='callSubClass(&lt;%# Eval("SubClassName") %&gt;); return false;'
  OnClick='"callSubClass("+&lt;%# Eval("SubClassName") %&gt;+"); return false;"'
  </code></pre>
  
  <p>What am I doing wrong? Thanks for any help provided.</p>