日期:2014-05-18  浏览次数:20516 次

GridView 调用Iframe问题(技术活)
我现在是需要Gridview在绑定数据后(GridView上的字段是HyperLinkField)点击一条记录,就可以更改Iframe中的内容,(比如Iframe绑定test.html,然后把test.html中的内容改掉)。请教高手

------解决方案--------------------
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
((HyperLink)e.Row.Cells[i].Controls[0]).Attributes.Add( "Onclick ", "document.yourFrame.src= 'xxx ';return false; ");
}//i -> HyperLinkField所在列
}