怎么向GridView中,动态添加Linkbutton
2个回答
展开全部
怎么样算动态?
根据不同文字形成链接么?可以用<a> 标签
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Text = "<a href='info.aspx?ID=" + e.Row.Cells[0].Text + "' target='_blank'>" + e.Row.Cells[0].Text + "</a>";
}
}
根据不同文字形成链接么?可以用<a> 标签
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Text = "<a href='info.aspx?ID=" + e.Row.Cells[0].Text + "' target='_blank'>" + e.Row.Cells[0].Text + "</a>";
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询