0

更新パネルでこの警告またはエラーが表示される理由がわからない

開始タグと終了タグの間にテキストを入れることはできません更新パネル

マークアップはこちら

<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>

私がグーグルで調べたので、誰かが何が悪いのか教えてもらえますか。何も間違っていません。

4

1 に答える 1

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 の外側に追加したテキストは、そのエラーを引き起こします。

これまでに示したコードには、エラーの原因となるものは何もありませんが、それを探す必要があります。おそらく、ページのどこかのコードのどこかにあるでしょう。

于 2013-05-09T14:43:42.457 に答える