Click here to Skip to main content
15,615,155 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
<asp:Button runat="server"id="ee" CommandArgument="<%#Eval("product_name") %>" />

What I have tried:

<asp:Button id="<%#Eval("product_name") %>" runat="server" OnClick="Bu1_Click" Text="Product Name" />
but again it shows parser error

I want to add "<%#Eval("product_name") %>" as button please help me?
Updated 7-Mar-21 18:01pm

1 solution

Try single quotes instead in Eval.

"<%#Eval('product_name') %>"
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900