当前位置:编程学习 > C#/ASP.NET >>

gridview动态超链接传值

gridview动态绑定数据库,后台超链接,我在DataBound中实现的,但不知道怎么传值,请高手解决。Details.aspx是传值到的网页,ID后面怎么写呢?还是我这种写法根本就不对?
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
             if (e.Row.RowType == DataControlRowType.DataRow)
            {
                 e.Row.Cells[3].Text = "<a   href='Details.aspx?ID= '   target='_self'>" + e.Row.Cells[3].Text + "</a>"; 
            }
        } --------------------编程问答-------------------- 不需要量写在GridView1_RowDataBound这个事件里,从数据库返回一个list,有多个字段,你想要绑定那一列要重新更新一下数据

foreach (var item in list)
{
item.col= "<a   href='Details.aspx?ID= '   target='_self'>" +item.col + "</a>"; 
}
-->col为list之中的一列
再把list绑定到datagridview


--------------------编程问答-------------------- 本才菜鸟,麻烦楼上讲详细点,做好有全部代码。
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,