using c# condtional operator in vb.net
Possible Duplicate:
Is there a conditional ternary operator in VB.NET?
I have the folowing code in asp.net for c# website but i have to use this code in vb.net site but im unable to convert the code even code translator please help me to do this.here is my code
<asp:CheckBox ID="chkStatus" runat="server"
AutoPostBack="true" OnCheckedChanged="chkStatus_OnCheckedChanged"
Checked='<%# Convert.ToBoolean(Eval("Approved")) %>'
Text='<%# Eval("Approved").ToString().Equals("True") ? " Approved " : " Not Approved " %>' />
</ItemTemplate>
</asp:TemplateField>
here i want to change this line Text='<%# Eval("Approved").ToString().Equals("True") ? " Approved " : " Not Approved " %>'
Text='<%# Eval("Approved").ToString().Equals("True") ? " Approved " : " Not Approved " %>'
for vb.net site please help me to do this.
至少使用Framework 3.5(VS 2008)的If
运算符:
Text='<%# If(Eval("Approved").ToString().Equals("True"), " Approved ", " Not Approved ") %>'
链接地址: http://www.djcxy.com/p/42842.html
上一篇: 用手来定义一个基于布尔表达式的字符串