Adding ScriptManager/UpdatePanel to Webpart gives me an error

Carson Wong asked on July 20, 2016 20:00

Hi,

I'm trying to create a new webpart and in it, I want some AJAX functionality. I read online that I could use UpdatePanels for that. I'm having issues when I add a ScriptManager and a UpdatePanel on the page. When I try to load the page, it gives me the following error:

"Error loading the WebPart 'X' of type 'X'".

The only code I have on the ascx file is the following:

<%@ Control ... %>
<asp:Label ID="Label1" runat="server" Text="Label" />

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runtat="server">
    <ContentTemplate>
    </ContentTemplate>
</asp:UpdatePanel>

When I remove the Script Manager and UpdatePane components, my webpart loads perfectly. What am I missing?

Correct Answer

Brenden Kehren answered on July 20, 2016 20:16

No need to add a script manager as it's already added by default because it is used by Kentico. Just add your update panels or just leave it as is and set the Use Update Panel property on the webpart to True.

You can also use the following control:

<cms:CMSUpdatePanel ID="pnlUpdate" runat="server">
  <ContentTemplate></ContentTemplate>
</cms:CMSUpdatePanel>
0 votesVote for this answer Unmark Correct answer

Recent Answers


Carson Wong answered on July 20, 2016 20:29

Thank you!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.