2014年7月13日 星期日

[RESOLVED] Set visible to linkbutton in gridview


I use 



Visible ='<%# IIf(Eval("main1") = "1", False, True)%>' />


in  gridview, but error:


Operator '=' is not defined for type 'DBNull' and string "1".


how i do? thanks for help.



this error for when that no data, for check the no data , how i do?



Visible ='<% # IIf(Convert.ToString(Eval ("main1")) = "1", False, True) %>'

To check no data use Visible ='<% # IIf(isdbnull(Eval ("main1")) , False, True) %>' if you still want to check the value, replace the True value with your iif(....)

沒有留言:

張貼留言