简体   繁体   English

在IFRAME页面上单击,将Datagrid刷新到Parent页面

[英]Refreshing Datagrid to the Parent page on click from the IFRAME page

I have a ASP.net page which has a Datagrid to display all the Records of a Table. 我有一个ASP.net页面,该页面具有一个Datagrid来显示表的所有记录。 On Click of an Add Button pops up an IFRAME with different .ASPX page to be saved as a new record. 单击“添加”按钮时,会弹出一个具有不同.ASPX页的IFRAME,并将其另存为新记录。 I would like to add the new record to the Datagrid on the parent page from the IFRAME. 我想将新记录从IFRAME添加到父页面上的Datagrid。

Please suggest how can I refresh the Datagrid alone without refreshing the entire page. 请提出如何单独刷新Datagrid而不刷新整个页面的建议。

Note: The Save button is in IFRAME in an another page and the Datagrid is in another Page. 注意:“保存”按钮在另一个页面的IFRAME中,而Datagrid在另一个页面中。

Thanks 谢谢

If you just want to refresh Datagrid only , you may consider Ajax . 如果只想刷新Datagrid,则可以考虑使用Ajax。 Here is the link 链接在这里

Or You may also consider a java script to refresh the grid, here is the code to give you an idea 或者,您也可以考虑使用Java脚本刷新网格,下面的代码可以帮助您

protected void grid_view_refesh()
{
    grid_view.Bind();
}

Button:

 <button id="btn_refresh" onclick="btn_refresh_click();">Refresh</button>

javascript

<script type="text/javascript" language="javascript">
 function grid_view_refesh()
  {
     // you code to refresh grid
  }

Hope it will help 希望对你有帮助

EDITED 已编辑

You can try this code on your popup windows ( Child window) 您可以在弹出窗口(子窗口)中尝试此代码

<script type="text/javascript">
    function CloseWindow() {
    window.close();
    window.opener.location.reload();
}

<input type="button" value="Close Window" onclick="javascript: return CloseWindow();" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM