Вопрос

I am using below code in gridview to show the status of the product. I have three status in gridview. I got the error "The name 'eval' does not exist in the current context"

<%# ((string)eval("fld_status") == "0") ? "~/images/arrow_yes.png" : ((string)eval("fld_status") == "1") ? "~/images/edit_msg.png" : "~/images/arrow_down.png" %>
Это было полезно?

Решение

C# is case sensitive language...so both eval and Eval is different...and the method for binding is Eval not eval..so you can try like this

<%#  ((string)Eval("fld_status") == "0") ? "~/images/arrow_yes.png" : ((string)Eval("fld_status") == "1") ? "~/images/edit_msg.png" : "~/images/arrow_down.png" %>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top