2013-05-09 42 views
0

爲什麼我不知道,爲什麼我收到這樣的警告或錯誤對我的更新面板,文本是不允許的開始和結束標記更新面板之間

文本是不允許的開始和結束標記更新之間面板

這裏; S標記

<script type="text/javascript"> 
    function bringPOPup() 
    {  
     $.blockUI({message: $('#anotherUP'), css: { width: '600px' } }); 
    } 
</script> 



<div id="anotherUP" style="display: none; cursor: default"> 
    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false"> 
     <ContentTemplate> 
       <asp:DropDownList ID="drop1" runat="server" EnableViewState="true" AutoPostBack="true" OnSelectedIndexChanged="Drop1_SelectedIndexChanged"/> 
     </ContentTemplate> 
    <Triggers> 
     <asp:AsyncPostbackTrigger ControlID="drop1" EventName="SelectedIndexChanged" /> 
    </Triggers> 
    </asp:UpdatePanel> 
</div> 
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true"> 
    <ContentTemplate> 
     <input type="button" id="Button3" value="Click me to Bring Pop Up" onclick="bringPOPup()" /> 
     <br /> 
    </ContentTemplate> 
</asp:UpdatePanel> 

有人能告訴我什麼是錯了,因爲我GOOGLE了它,並沒有什麼即將到來的錯誤。

+0

請發佈完整的代碼,因爲我已將其粘貼到我的頁面中,但沒有收到您指定的錯誤。也請檢查標籤。 – Ratna 2013-05-09 09:12:26

+0

請參考我在這篇文章中發佈的代碼,感謝您的時間先生。 – Mathematics 2013-05-09 09:29:28

回答

2

這個錯誤表明的是你不能在UpdatePanel裏面直接輸入純文本 - 唯一可以作爲UpdatePanel的子節點的是<Triggers><ContentTemplate>

這裏是什麼是不允許的一個例子:

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true"> 
    You can't put text right here, this will cause an error! 
    <ContentTemplate> 
     <input type="button" id="Button3" value="Click me to Bring Pop Up" onclick="bringPOPup()" /> 
     <br /> 
    </ContentTemplate> 
</asp:UpdatePanel> 

我加入的ContentTemplate外的文本將導致錯誤。

我沒有看到任何代碼,你迄今顯示的代碼會導致錯誤,但這是你需要尋找的。它可能在頁面其他地方的代碼中。

相關問題