Hi!
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.
So far, I've used the following code, but it does not work:
<asp:CheckBox ID="CheckBox"
runat="server"
Text=""
Checked='<%# Convert.ToBoolean(Eval("Selected")) %>'
onchange="changeTotal(this, <%# Eval("Price")) %>)"
/>
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.
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 <%# Eval("Price")) %> part from the checkbox, the code compiles without errors.