UpdatePanel - Updates not working

hversemann

Member
Joined
Jul 29, 2016
Messages
11
Location
midwest
Programming Experience
3-5
I'm trying to make an update panel on a Web App. page show updates to a label control within the same panel and also using an invisible button in the panel to trigger the panel updates with its Click event.
Here is my complete update panel code from my Web App. page:
C#:
     <asp:UpdatePanel ID="PullRubricPageUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false" >        <ContentTemplate>
            <br />                                        
            <asp:Label ID="UpdatePanelLabel" runat="server" Text="" Font-Bold="true" ForeColor="#ff0066"></asp:Label>
            <asp:Button ID="UpdatePanelButton" runat="server" Text="Update Panel" Visible="false" OnClick="UpdatePanelButton_Click" />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="UpdatePanelButton" ></asp:AsyncPostBackTrigger>
        </Triggers>
    </asp:UpdatePanel>
Based on all of the reading that I've done on update panels and how they should work I believe I have most of the needed markup and options selected, to make it work.
Here is how my scriptmanager, on my master page is setup:

C#:
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">

and finally here's the routine that updates the label (UpdatePanelLabe) text property and calls the UpdatePanelButton.Click() event to try to trigger the refresh of just the PullRubricPageUpdatePanel(showing the UpdatePanelLabel's new verbiage):
    protected void DisplayUpdatePanelLabelMessage(string msg)
    {
        method = "DisplayUpdatePanelLabelMessage";


        try
        {
            Label UpdatePanelLabel = (Label)PullRubricPageUpdatePanel.FindControl("UpdatePanelLabel");
            UpdatePanelLabel.Text = msg;
            Button UpdatePanelButton = (Button)PullRubricPageUpdatePanel.FindControl("UpdatePanelButton");
            UpdatePanelButton_Click(new object(), new EventArgs());
        }
        catch (Exception excptn)
        {
            Exception myExcptn = new Exception(module + method + "_Exception thrown - " + excptn.Message);
            throw myExcptn;
        }
        finally
        {


        }
    }

I think I have all of the pieces in place, but the updates/refreshes of the PullRubricPageUpdatePanel are still just not happening.

I would greatly appreciate any help anyone can provide.

Thanks.

Henry
 
Last edited by a moderator:
Back
Top Bottom