如何使用不回发的OnselectedIndexChange?

问题描述 投票:0回答:1

我有2个下拉列表,我需要第一个(ActionList)来控制第二个(JustificationList)的值。问题是,当我在第一个下拉列表中包含AUtopostabck时,我的整个页面都刷新了。

我尝试使用updatePanel和触发器,但仍然无法正常工作。没有错误,只是刷新发生在“索引已更改”上。

    <ContentTemplate>
            <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
            <input class="form-control" id="myInput" type="text" placeholder="Search.." autocomplete="off" style="width: 80%; margin-left: 25px; margin-bottom: 10px;">

            <asp:Label Text="Update Selection" runat="server" Style="width: 80%; margin-left: 25px; margin-bottom: 10px; color: white"></asp:Label>

            <asp:DropDownList ID="ActionList" runat="server" AutoPostBack="true" CSSclass="form-control"  style="width: 80%; margin-left: 25px; margin-bottom: 10px;" OnSelectedIndexChanged="JustificationData"  ></asp:DropDownList>
            <asp:DropDownList ID="JustificationList" runat="server" CSSclass="form-control"  style="width: 80%; margin-left: 25px; margin-bottom: 10px;" ></asp:DropDownList>


                     </ContentTemplate>
         <Triggers>
    <asp:AsyncPostBackTrigger ControlID="ActionList"  />
</Triggers>
</asp:UpdatePanel>

我在做什么错了?

c# asp.net postback
1个回答
0
投票

需要查看OnselectedIndexchanged的后端代码。

© www.soinside.com 2019 - 2024. All rights reserved.