2013-04-10 57 views
0

我有Modal彈出式擴展器中的更新面板,並且在masterpage中有腳本管理器,但是當我運行網站時,出現以下錯誤: [InvalidOperationException:ID爲'udpOutterUpdatePanel'的控件需要Sasp.net updatepanel

criptManager on the page. The ScriptManager must appear before any controls that need it.] 
    System.Web.UI.UpdatePanel.get_ScriptManager() +303 
    System.Web.UI.UpdatePanel.RegisterPanel() +170 
    System.Web.UI.UpdatePanel.RegisterPanel() +132 
    System.Web.UI.UpdatePanel.OnInit(EventArgs e) +53 
    System.Web.UI.Control.InitRecursive(Control namingContainer) +605 
    System.Web.UI.Control.InitRecursive(Control namingContainer) +323 
    System.Web.UI.Control.InitRecursive(Control namingContainer) +323 
    System.Web.UI.Control.InitRecursive(Control namingContainer) +323 
    System.Web.UI.Control.InitRecursive(Control namingContainer) +323 
    System.Web.UI.Control.InitRecursive(Control namingContainer) +323 
    System.Web.UI.Control.InitRecursive(Control namingContainer) +323 
    System.Web.UI.Control.InitRecursive(Control namingContainer) +323 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2241 

當我在頁面中添加scriptmanager時,它給出的錯誤是「只允許一個實例」。 請幫我解決這個問題。 我使用Windows 7,VS2010

在此先感謝...

回答

0

你確定你的「模式彈出擴展」鏈接到母版頁與其中包含「ScriptManager的」從大師「ContentPlaceHolderID」頁面?這樣它可以加載「ScriptManager」!

<%@ ... MasterPageFile="~/MasterFile.master" .... %> 

<asp:Content ID="myContent" ContentPlaceHolderID="ContentScriptManager" Runat="Server"> 
</asp:Content> 
+0

感謝您的回覆,問題解決了。Script Manager不在Master頁面的適當位置。 – user1871770 2013-04-10 10:00:42

0

您還可以添加的ScriptManagerProxy在內容頁面,這使得嵌套的組件,如內容的網頁時ScriptManager控件的父元素已經被定義爲腳本添加到頁面。