I have a item in a listView control like this
<asp:Label ID="Label2" runat="server" Text='<%#Eval("Open") %>' />
The 'open' is coming from a database via linq to sql. The open can either have a value of Y, or N. I want it to say instead 'Open' or 'Closed'.
What is the best way to do this? Can I do it in t开发者_如何转开发he mark up?
<%#Eval("Open") == "Y"? "Open" : "Closed" %>
But if those are the only possible values, you might want to consider changing the type to a bit.
精彩评论