ItemDataBound怎样做到对DataGrid中的绑定的文字实现超级连结

解决方案 »

  1.   

    if((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
    {
        e.Item.Cells[0].Text = "<a href='" + e.Item.Cells[0].Text + "'> + e.Item.Cells[0].Text + "</a>";
    }不知道是不是这个意思
      

  2.   

    可以不用itemdatabound的,
    <asp:datagrid id=... ...>
    <ItemTemplate>
      <a href='<%# "绑定字段"%>' ..../></ItemTemplate>
    ....
    </asp:datagrid>
      

  3.   

    楼主的做法行的通。
    一楼的,别老是用那个,虽然好使,但是那个是late binding,有peformance 的问题。
      

  4.   

    WHO?
    楼主?一楼?二楼?
      

  5.   

    不好意思, 是最上边的回答,和第二个回答。最上边的回答:做法行的通
    第二个回答:别老是用那个,虽然好使,但是那个是late binding,有peformance 的问题