首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

GridView 调用Iframe有关问题(技术活)

2011-12-15 
GridView 调用Iframe问题(技术活)我现在是需要Gridview在绑定数据后(GridView上的字段是HyperLinkField)点

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所在列
}

热点排行