How to use a ASP.NET Eval() function in a ternary operator?

后端 未结 2 1037
南笙
南笙 2021-01-22 03:41

I am looking to evaluate two strings from my dataset to identify a class description using a ternary operator. I continue to get a compiler error when running this code stating

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-22 04:08

    Try this

    <%#Eval("Status").ToString()=="1" ? "ClubMember" : "Free User" %>
    

提交回复
热议问题