各位大虾好,我现在做一个产品系统,但在用datalist对数据库里的文字显示的时候有问题,具体如下:
   比如我在添加产品的时候格式为
                             参数1:XXXXX
                             参数2:QQQQQ
                             参数3:66666说明下,以上的参数都在一个字段里(因为产品太杂乱,不好归类)。但我显示出来就成了
                             参数1:XXXXX  参数2:QQQQQ 参数3:66666请各位指点怎么能实现我的要求呢

解决方案 »

  1.   

    public string StrDecode(string content)
    {   
    content=content.Replace("script","s cript");
    content=content.Replace("&","&");
    content=content.Replace("''","'");
    content=content.Replace("\t","   "); 
    content=content.Replace(" "," ");
    content=content.Replace("<","&lt;"); 
    content=content.Replace(">","&gt;");
    content = content.Replace("\n","<BR>");
    return content;
    }
      

  2.   

    用这个StrDecode处理这个字段    应该添加模板列
      

  3.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=A27CA611-2DE7-432D-8DBC-1512CEFDAA53
      

  4.   

    <%# StrDecode(DataBinder.Eval(Container, "DataItem.字段名").ToString()) %>
      

  5.   

    string str = str.Replace("<br>","\n");
      

  6.   

    asp600(剑气潇潇) 
    谢谢你的回答,但我加上去编译出现错误,请指点下。谢谢