<asp:BoundField HeaderText="公告属性" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center" DataField="Ontop"/>Ontop是表中的一个属性列,值为true和false,我想输出的结果是:为true时,输出"固顶";为false时,输出"不固顶"

解决方案 »

  1.   

    声明个枚举
     public enum ESysEnabled
    {
      true,
      false}
    rowdatabound事件中
    写判断
      

  2.   

    Server.HtmlDecode("<STYLE TYPE="text/css">
    <!--
    P { text-indent: 5cm; background: yellow;color: red; font-family: courier }
    -->
    </STYLE>
    <p>我再顶顶,嘿嘿</p>")
      

  3.   


    <STYLE TYPE="text/css">
    <!--
    P { text-indent: 5cm; background: yellow;color: red; font-family: courier }
    -->
    </STYLE>
    <p>55555</p>
      

  4.   

    直接在sql语句写:
    SELECT *,(CASE Ontop WHEN 1 THEN '固定' ELSE '不固顶' END) AS Ontop_ FROM [TABLE_NAME] ...