Hello there,
I've some problem with update panel (UP) in parent form blinking after __doPostBack() from child is called
When i do some action, like update som record in child (popup) window, I want to close the window, and force postback to parent.
Problem is, that after this, althought that page content is in UP, the page blinks...
this is the script I call from child
if (!Page.ClientScript.IsStartupScriptRegistered("CloseAjaxWithReload"))
{
// Prepare the script to close the window
StringBuilder script = new StringBuilder();
script.Append("<script type=\"text/javascript\">");
script.Append("window.open('', '_self', '');");
script.Append("window.opener.__doPostBack('child');");
script.Append("window.close();");
script.Append("</script>");
ScriptManager.RegisterStartupScript(this, this.GetType(), "CloseAjaxWithReload", script.ToString(), false);
}
Then in parent's page load, I catch, that postback was forced by child.
protected void Page_Load(object sender, EventArgs e)
{
string eventTarget = (this.Request["__EVENTTARGET"] == null) ? string.Empty : this.Request["__EVENTTARGET"];
if (!IsPostBack)
{
// Do nothing
}
else
{
if (eventTarget == "child")
{
// Call listview databind
ReloadList();
}
}
}Whole content is in masterpage content and in UP.
<asp:Content ID="AccountListContent" ContentPlaceHolderID="cphContent" runat="server">
<asp:UpdatePanel ID="upMain" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="cphContent" />
</Triggers>
<ContentTemplate>
//page content is here, also the listview
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
Everithing work's fine, except the page blink.
Any idea why is the page blinking???
Thx for any help, suggestion, whatever :)