1

こんにちは、このような更新パネルがあります

<asp:UpdatePanel ID="Updatepanel1" runat="server">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="RadioButtons1" EventName="SelectedIndexChanged" />
        <asp:AsyncPostBackTrigger ControlID="DropDown1" EventName="SelectedIndexChanged" />
        <asp:AsyncPostBackTrigger ControlID="DropDown2" EventName="SelectedIndexChanged" />
        <asp:AsyncPostBackTrigger ControlID="DropDown3" EventName="SelectedIndexChanged" />
    </Triggers>
    <ContentTemplate>
        <asp:Label runat="server" Text="LabelToUpdate"></asp:Label>
    </ContentTemplate>

</asp:UpdatePanel>

上記のトリガーのいずれかが発生するたびに、ラベルを更新したいと考えています。

初めてトリガーすると、すべてが完全に正常に機能します。しかし、その後、何かを変更しても更新はありません (AutoPostBack最初の部分投稿が戻った後にすべてのコントロールが false に設定されるように、選択を 2 回目に変更しても何も起こりません)。

どんな助けでも大歓迎です

ありがとうございました

4

1 に答える 1

0

これをコピーして貼り付けます..正常に動作します:)

<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:RadioButtonList ID="RadioButtons1" runat="server" AutoPostBack="true">
        <asp:ListItem Text="1" Selected="True"></asp:ListItem>
        <asp:ListItem Text="2"></asp:ListItem>
        <asp:ListItem Text="3"></asp:ListItem>
        <asp:ListItem Text="4"></asp:ListItem>
    </asp:RadioButtonList>
    <br />
    <asp:DropDownList ID="DropDown1" runat="server" AutoPostBack="true">
        <asp:ListItem Text="1" Selected="True"></asp:ListItem>
        <asp:ListItem Text="2"></asp:ListItem>
        <asp:ListItem Text="3"></asp:ListItem>
        <asp:ListItem Text="4"></asp:ListItem>
    </asp:DropDownList>
    <br />
    <br />
    <asp:DropDownList ID="DropDown2" runat="server" AutoPostBack="true">
        <asp:ListItem Text="1" Selected="True"></asp:ListItem>
        <asp:ListItem Text="2"></asp:ListItem>
        <asp:ListItem Text="3"></asp:ListItem>
        <asp:ListItem Text="4"></asp:ListItem>
    </asp:DropDownList>
    <br />
    <br />
    <asp:DropDownList ID="DropDown3" runat="server" AutoPostBack="true">
        <asp:ListItem Text="1" Selected="True"></asp:ListItem>
        <asp:ListItem Text="2"></asp:ListItem>
        <asp:ListItem Text="3"></asp:ListItem>
        <asp:ListItem Text="4"></asp:ListItem>
    </asp:DropDownList>
    <br />
    <br />
    <asp:UpdatePanel ID="Updatepanel1" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="RadioButtons1" />
            <asp:AsyncPostBackTrigger ControlID="DropDown1" />
            <asp:AsyncPostBackTrigger ControlID="DropDown2" />
            <asp:AsyncPostBackTrigger ControlID="DropDown3" />
        </Triggers>
        <ContentTemplate>
            <asp:Label ID="Label1" runat="server" Text="LabelToUpdate"><%= "rad: " + RadioButtons1.SelectedItem.Text + "<br />" + "drop1: " + DropDown1.SelectedItem.Text + "<br />" + "drop2: " + DropDown2.SelectedItem.Text + "<br />" + "drop3: " + DropDown3.SelectedItem.Text %></asp:Label>
        </ContentTemplate>
    </asp:UpdatePanel>
于 2011-10-23T16:47:10.497 に答える