title: asp.net checkbox in listview calling javascript code onchange
body: <p>In an ASP:ListView control, I have a checkbox for each row. Each row represents a product with a corresponding price. I want the customer to select one or more products and calculate a total price client side. </p>
  
  <p>So far, I've used the following code, but it does not work:</p>
  
  <pre><code>&lt;asp:CheckBox ID="CheckBox" 
                runat="server" 
                Text="" 
                Checked='&lt;%# Convert.ToBoolean(Eval("Selected")) %&gt;'
                onchange="changeTotal(this, &lt;%# Eval("Price")) %&gt;)"
  /&gt;
  </code></pre>
  
  <p>I have a javascript function changeTotal(referer, value) which should determine if the product was just selected and add/subtract the product price from a total.</p>
  
  <p>The PROBLEM is the javascript function assignment in the CheckBox definition - what is wrong with this approach? Why can't I assign a static price for the javascript function? When I remove the <code>&lt;%# Eval("Price")) %&gt;</code> part from the checkbox, the code compiles without errors.</p>