pcs
pcs

Reputation: 1854

What is script manager and updatepanel

I m new to .net, When i workout particular script in visual studio, I got the warning message like this:

Cannot unregister UpdatePanel with ID 'UpdatePanel1' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.

Parameter name: updatePanel

.aspx file:

     <asp:UpdatePanel ID="UpdatePanel5" runat="server"> <ContentTemplate> 
<asp:Label runat="server" ID="lblInboxCount" CssClass="inboxCount" 
Text="Inbox (0)"></asp:Label> </ContentTemplate> </asp:UpdatePanel>

this code for master page:

<asp:ScriptManager ID="ScriptManager2" runat="server">
    </asp:ScriptManager>

May i know, what is ScriptManager and UpdatePanel? and what is the function in asp .net?.. I referred msdn and other some materials, but still i didn't get it.

can anyone help me to fix this?

Thanks,

Upvotes: 0

Views: 10905

Answers (2)

Swag
Swag

Reputation: 2140

You have to add something like this in your ASP page:

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

And something similar for UpdatePanel:

<asp:UpdatePanel id="UpdatePanel1" runat="server">
        <contenttemplate>
        </contenttemplate>
</asp:UpdatePanel>

UpdatePanel is used to prevent page refresh after a postback that occurs when you for example press a button. You just refresh that particular part of the page instead of the whole page.

Upvotes: 2

Donal
Donal

Reputation: 32713

The UpdatePanel is used to perform partial page refreshes. It will AJAX'ify controls contained within it, allowing partial rendering of the area.

When you use an UpdatePanel, you also need to include a ScriptManager. The ScriptManager manages the Ajax script libraries and script files. It also manages partial-page rendering, and client proxy class generation for Web and application services.

Upvotes: 1

Related Questions