views:

45

answers:

0

I have an update panel on my aspx page that has a user control as an asyncpostback trigger. The user control has a set of image buttons that refresh the update panel when clicked. This all works fine on IE and 70% of the time on FF and Chrome however, 30% the update panel never is updated. I have debugged IIS and the server side code is never even being hit. Below is simplified version of my setup.

<form>
<ccc:CustomUserControl ID="cContrl" runat="server" />

<asp:UpdatePanel ID="MainUpdatePanel" runat="server" UpdateMode="Conditional">
     <Triggers>
         <asp:AsyncPostBackTrigger ControlID="cContrl" />
     </Triggers>
        <ContentTemplate>

        </ContentTemplate>
</asp:UpdatePanel>

</form>

Then here is my user control markup

<span>
<cc:CustomLinkButton ID="btnSettings" runat="server" ImageUrl="btnSettings.png"/>
</span>

And here is the code behind for the btnSettings Click event

private Panel MainContent
    {
        get
        {
            return this.Parent.FindControl("MainContent") as Panel;
        }
    }

private void UpdateMainContent()
{
    UpdatePanel updatePanel = this.Parent.FindControl("MainUpdatePanel") as UpdatePanel;
    updatePanel.Update();
}

protected void Page_Init(object sender, EventArgs e)
{
    RegisterScriptFile("TopToolBar.js");
    btnSettings.Click += new ImageClickEventHandler(btnHome_Click);
}

void btnSettings_Click(object sender, ImageClickEventArgs e)
{
    var customerInfoControl = Page.LoadControl("~/Views/Home.ascx");
    MainContent.Controls.Add(customerInfoControl);
    UpdateMainContent();
}

I have also tried blocking browser cache on FF and Chrome but it changes nothing. See below

    if (Request.Browser.MSDomVersion.Major == 0) // Non IE Browser?)
    {
        Response.Cache.SetNoStore(); // No client side cashing for non IE browsers
    }