开发者

ASP ListView Formatting

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜