Ok , this is running me nuts. I have tried any possible solution and it is not working.
Here is the problem:
I have a gridview in my parent page. Each row has an "Edit" button which opens a new page:
<asp:Button ID="Button1" runat="server" CausesValidation="false" CommandName="" Text="Edit" OnClientClick='<%# Eval("ID", "window.open(\"EditFrm.aspx?ID={0}\", null, \"width=700,height=600,top=100,left=300\", \"true\");") %> '/>
in Child page, I populate all the fields from db and with clicking on "update" save all the data into dab and close the current page:
<script>
function RefreshParent() {
window.opener.document.getElementById('Button1').click();
window.close();
}
</script>
Button1 includes a method to refresh Gridview data from db.
I have tried following code but it doesn't refresh the gridview:
window.opener.location.reload(true);
Here is the definition of gridview in my parent window:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" AutoGenerateDeleteButton="True" OnRowDeleted="GridView1_RowDeleted" OnRowDeleting="GridView1_RowDeleting" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical">
<AlternatingRowStyle BackColor="#DCDCDC" />
<Columns>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:Button ID="Button1" runat="server" CausesValidation="false" CommandName="" Text="Edit" OnClientClick='<%# Eval("ID", "window.open(\"EditFrm.aspx?ID={0}\", null, \"width=700,height=600,top=100,left=300\", \"true\");") %> '/>
</ItemTemplate>
</asp:TemplateField>
// Column definition
<Triggers>
<asp:AsyncPostBackTrigger ControlID="GridView1" />
</Triggers>
</asp:UpdatePanel>
Any support is appreciated.