C# 按钮没有在更新面板内启动,查看了其他问题,但修复都不起作用

C# 按钮没有在更新面板内启动,查看了其他问题,但修复都不起作用,c#,asp.net,C#,Asp.net,因此,我有一个更新面板: <asp:UpdatePanel runat="server" RenderMode="Inline" UpdateMode="Conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnSubmit" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="

因此,我有一个更新面板:

<asp:UpdatePanel runat="server" RenderMode="Inline" UpdateMode="Conditional">

    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnSubmit" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="ddOutcomeType" />
        <asp:AsyncPostBackTrigger ControlID="ddOutcomeCode" />
    </Triggers>

    <ContentTemplate>
        <fieldset>

            <asp:DropDownList ID="ddOutcomeType" runat="server" AutoPostBack="True" 
                 OnSelectedIndexChanged="ddOutcomeType_OnSelectedIndexChanged">
                <asp:ListItem Value="0">Please Select...</asp:ListItem>
                <asp:ListItem Value="EDU">Continuing in Education</asp:ListItem>
                <asp:ListItem Value="EMP">Paid Employment</asp:ListItem>
                <asp:ListItem Value="NPE">Not in Paid Employment</asp:ListItem>
                <asp:ListItem Value="GAP">Gap Year</asp:ListItem>
                <asp:ListItem Value="OTH">Other</asp:ListItem>
            </asp:DropDownList>

            <asp:DropDownList ID="ddOutcomeCode" runat="server" DataTextField="COMPDESC" 
                 DataValueField="EBSVALUE" 
                 OnSelectedIndexChanged="ddOutcomeCode_OnSelectedIndexChanged"
                 AutoPostBack="True" Visible="false" />

            <br /><br />
            <asp:Label ID="lblDestMessage" runat="server" 
                 Text="Please start typing at least 3 characters of the HE institute 
                       then select from the list (Don't make your own up!)" 
                 Visible="false">
            </asp:Label>

            &nbsp;&nbsp;&nbsp;&nbsp;

            <h4 style="align-content:center;">
            <asp:Label ID="Label1" runat="server" Text="Comments on Destination">
            </asp:Label></h4>
            <asp:TextBox ID="txtDestComments" runat="server" Width="70%"></asp:TextBox>
            <br />
            <asp:RegularExpressionValidator ID="validJust" runat="server" 
                 Display="Dynamic" ControlToValidate="txtDestComments" 
                 ValidationExpression="^([\S\s]{0,249})$" CssClass="label label-danger" 
                 ErrorMessage="Please enter maximum 250 characters" 
                 SetFocusOnError="True">
            </asp:RegularExpressionValidator>
            <br />



            <asp:Button ID="btnSubmit" runat="server" Text="Submit" 
                 CssClass="btn btn-primary" OnClick="btnSubmit_OnClick" />

        </fieldset>
    </ContentTemplate>
</asp:UpdatePanel>

请选择。。。
继续教育
有偿就业
没有带薪工作
空档年
其他




我已经研究了同一个问题的其他问题,但是没有一个修复程序可以解决这个问题,我尝试将按钮放在更新面板之外,但是下拉列表更改的隐藏字段不会在更新面板之外保持更改


有什么帮助吗?

您正在使用更新面板的UpdateMode属性作为UpdateMode=“Conditional”。您必须在服务器端的按钮单击事件中显式使用Update panel的Update()方法来更新Update panel中的内容,或者删除此UpdateMode属性,因为默认情况下该属性设置为始终不变