例如这是一个表的一部分姓名 发货时间    是否收到
张三  09.09.12   收到
李四  09.10.01   确认收到
就是如果是否收到的这个字段是没有收到,则出现一个确认收到的链接,点击则进入确认收到页面

解决方案 »

  1.   

    sql里面就可以实现。when 字段1 '收到' then 'abc.aspx'或查询出来的DataTable在从新判断。foreach DataRow dr in DataTable1.Rows
    {
       if(dr["字段"]=="收到")
         dr["字段"]="";
    }
      

  2.   

    sql还可以这样用啊
    但是加入链接可以吗select * from  sendinfo when isreceive=null then ' <a href="abc.aspx">未收到</a>' 
    这样好像不行
    第二种用gridview的话不知该怎么写
      

  3.   

    天,,不知道怎么写,你不知道去查啊不要select * select isnull(字段1,'你需要的字符串') as 字段1 from
      

  4.   

    是when呀  ? 好像是if  then在存储过程里面
      

  5.   

    绑定后在gridview中替换“没有收到”
    例如在gridview模板列中你用asp:label来绑定是否受到这个字段
    后台代码
    for(int i=0;i<GridView1.Rows.Count;i++)
    {
        Label lbsd=(Label)GridView.Rows[i].FindControl("lb");
        if(lbsd.Text=="没有收到")
        {
             lbsd.Text="<a href="abc.aspx">未收到 </a>";
        }
    }
      

  6.   

    对了,代码放在GridView1的DataBound中
      

  7.   

    最简单的方式
    在数据绑定控件中,如:
    repeater中:<ItemTemplate>
    <%#Eval("字段名")==null?"<a href='1.aspx' target='_blank'>确认</a>":"" %>
    </ItemTemplate>