2011-07-25 37 views

回答

1

你可以寫一個輔助方法:

public static string FreshLabel(object value) 
{ 
    if ((string)value == "Fresh") 
    { 
     return "Untouched"; 
    } 
    return "Touched"; 
} 

,然後綁定列使用你的數據裏面:

<asp:Label runat="server" Text='<%# FreshLabel(Eval("SomeColumn")) %>' /> 
+0

由於一噸達林! – inlokesh