I am using a table inside a repeater. Basically I want to pass to pass the Data from the SQL Data Source and pass it to a function at the server side using anchor tag.
<td>
<%# Eval("Quantity")%>+ in stock<br />
<input class="textbox" maxlength="2" name="Quantity" size="2" type="text"
value="1" />
<br />
<div class="buttons">
<a id="A1" class="positive" runat="server" onserverclick="addtocart(<%# Eval("ProductDescriptionId")%>,<%# Eval("Quantity")%>
Add to Cart
</a>
</div>开发者_JAVA技巧
It is this particular hyperlink where I want to pass the parameters.
<a id="A1" class="positive" runat="server" onserverclick="addtocart(<%# Eval("ProductDescriptionId")%>,<%# Eval("Quantity")%>Add to Cart</a>
The link should probably look like this:
<a id="A1"
class="positive"
runat="server"
onserverclick='addtocart(<%# Eval("ProductDescriptionId")%>,<%# Eval("Quantity")%>)'>
Add to Cart
</a>
精彩评论