0

I have a ASP.net page which has a Datagrid to display all the Records of a Table. On Click of an Add Button pops up an IFRAME with different .ASPX page to be saved as a new record. I would like to add the new record to the Datagrid on the parent page from the IFRAME.

Please suggest how can I refresh the Datagrid alone without refreshing the entire page.

Note: The Save button is in IFRAME in an another page and the Datagrid is in another Page.

Thanks

4

1 回答 1

0

如果你只想刷新 Datagrid,你可以考虑 Ajax。链接在这里

或者你也可以考虑一个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
  }

希望它会有所帮助

已编辑

您可以在弹出窗口(子窗口)上尝试此代码

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

<input type="button" value="Close Window" onclick="javascript: return CloseWindow();" />
于 2013-07-15T07:30:55.783 回答