开发者

Passing database data through anchor tag in ASP.NET

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜