i got a master page and some web pages on this. Page1 have one gridview and populating some data on that and it has add and edit button on the side of gridview. once i click the add/edit button it will open the popup window the code is below
<pre> ImageButton btnEdit = (ImageButton)sender;
GridViewRow row = (GridViewRow)btnEdit.NamingContainer;
string url;
url = "Add-Leave.aspx?a=E&id=" + txtEmployeeCode.Text.Trim() + "&acc=" + ((HiddenField)row.FindControl("hidRecID")).Value + "&year=" + ((HiddenField)row.FindControl("hidYear")).Value;
Response.Write("<script>window.open('" + url + "',400,600);</script>");
once the data is added/updated , i want to update the page1 gridview.
i try to create the btnrefresh in page1 and make databind for the gridview. i try to call this button click from pupop window as below
<pre> <div id="dvScript" runat="server">
<script type="text/javascript">
$(document).ready(function () {
var cpframe = top.document.getElementById('contframe');
if (cpframe) {
cpframe.contentWindow.document.getElementById('cphMain_btnRefresh').click();
}
});
</script>
</div>
it is not updating or giving any error.
thanks for the support
What I have tried:
i tried also
i add one more button
<pre lang="HTML"><pre> <input id="Button2" type="button" value="Reset" />
try to create another funtion
function refresh() {
var cpframe = top.document.getElementById('contframe');
if (cpframe) {
cpframe.contentWindow.document.getElementById('cphMain_btnRefresh').click();
}
}
$(document).ready(function () {
$("#Button2").click(function () {
refresh();
});
});
code behind on the button save click()
Page.ClientScript.RegisterStartupScript(this.GetType(), "reset", " refresh();", true);