Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

How to pass Eval value in JavaScript using checkbox OnClick. I am using the below code.

Please help me correct this tag

ASP.NET
asp:CheckBox ID="chkBox" runat="server" Text="Text" AutoPostBack="false" 
OnClick="checkFeild(this, '<%#Eval("ID") %>');" />



Thanks,
Ajay
Posted

1 solution

Do you know about the second parameter of Eval function ?? Take advantage of it ;)

Like ’<%# Eval(“Id”,”return fun1( {0} )”)%>’
Where fun1() is some function which accepts one argument. You can do similar kinda thing.

-KR
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 5-Mar-14 10:46am    
I could not find eval with two arguments. Any links?
And what difference can it make, in this very case?
—SA
Member 12029448 28-Feb-17 6:42am    
i have same problem,please help

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