I have 2 pages each with an update panel. It has the same content and the same trigger on both pages.
This is how it looks:
<div id="rating">
<span class="rateTxt">Rate</span>
<telerik:RadRating ID="RadRating1" runat="server" ItemCount="5" SelectionMode="Continuous"
Precision="Item" Skin="Default" OnRate="RadRating1_Rate" AutoPostBack="true">
</telerik:RadRating>
</div>
</li>
</ul>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<div id="divAddMessage" runat="server" visible="false">
<span class="rateTxt">Do you want to add a comment?</span>
<asp:TextBox runat="server" ID="txtComment" TextMode="MultiLine" Rows="3" Width="195">
</asp:TextBox>
<br />
<br />
<asp:ImageButton runat="server" ID="lnkAddComment" ImageUrl="~/App_Themes/123reg/Images/submit-rating.png"
OnClick="lnkAddComment_Click" OnClientClick="showSuccessMessage();" />
<br />
<br />
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="RadRating1" EventName="Rate" />
</Triggers>
</asp:UpdatePanel>
Now when the user rates something with the RadRating the Rate event is triggered which causes a postback.
On the handler for the Rate event I do the following:
protected void RadRating1_Rate(object sender, EventArgs e)
{
divAddMessage.Visible = true;
}
The same code is exactly on 2 pages. On one page it updates the divAddMessage and it becomes visible but on another page it doesn't become visible. Even if I set it to visible on that page when it postback again the Visible property is still false even after setting it to true in the above handler.
I only set the visibily to false in the aspx file and in the above handler I set it to true.
It turns out that I get an error in the javascript console:
Sys.InvalidOperationException: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'ctl00_mainContentPlaceHolder_updatePanel'. If it is being updated dynamically then it must be inside another UpdatePanel.
I have another update panel inside a multiview. But because the active view is not the one with the update panel on postback the update panel isn't rendered.