62,268
社区成员
发帖
与我相关
我的任务
分享
<asp:GridView ID="dgvPendinglist" runat="server" >
<Columns>
<asp:TemplateField HeaderText="temp" >
<ItemTemplate>
<iframe id="iframe" name="iframe" runat="server" width="700px" scrolling="no" height="100px"></iframe>
</ItemTemplate>
<ItemStyle Width="700px"></ItemStyle>
</asp:TemplateField>
</Columns>
</asp:GridView>
protected void dgvPendinglist_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
GridViewRow row = e.Row;
System.Web.UI.HtmlControls.HtmlGenericControl ct = (System.Web.UI.HtmlControls.HtmlGenericControl)row.Cells[2].FindControl("iframe");
ct.Attributes["src"] = "test.aspx?documentID="+row.Cells[0].Text.Trim()+"";
}
}
protected void Button1_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(GetType(), "js", "<script>aaa();</script>");
}
function aaa()
{
//alert('');
window.frames[1].document.getElementById('Button1').onclick();
}
function aaa()
{
alert('');
window.frames[1].document.getElementById('Button1').onclick();
}
<script language="javascript" type="text/javascript">
function aaa()
{
window.frames[0].document.getElementById('Button1').onclick();
}
function bbb()
{
setTimeout('aaa()',100);
}
</script>