DropDownList OnSelectedIndexChanged

时间:2018-01-05 15:52:43

标签: asp.net drop-down-menu selectedindexchanged

我有2个DropDownList(实体和进程),第二个是根据OnSelectedIndexChanged事件在第一个列表中选择的值进行的。 问题是,当我更改进程DDL上的选择时,将触发实体DDL的OnSelectedIndexChanged。

                    <asp:GridView runat="server"
                        ID="pEntityProcess_GridView"
                        AllowPaging="true" PageSize="200" PagerStyle-HorizontalAlign="Center"
                        ShowHeader="true" ShowFooter="true" AutoGenerateColumns="false" HorizontalAlign="Left" Width="600px"
                        DataKeyNames="EntityProcessID"
                        OnRowDataBound="pEntityProcess_GridView_RowDataBound"
                        OnRowEditing="pEntityProcess_GridView_RowEditing"
                        OnRowCancelingEdit="pEntityProcess_GridView_RowCancelingEdit"
                        OnRowUpdating="pEntityProcess_GridView_RowUpdating"
                        OnRowDeleting="pEntityProcess_GridView_RowDeleting"
                        OnPageIndexChanging="pEntityProcess_GridView_PageIndexChanging"
                        FooterStyle-HorizontalAlign="Center">

                        <Columns>
                            <asp:TemplateField HeaderText="Entités" InsertVisible="False" ItemStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:Label ID="pEntityProcess_EntityId_lbl" Visible="false" runat="server" Text='<%# Bind("EntityId") %>' />
                                    <asp:Label ID="pEntityProcess_EntityName_lbl" runat="server" Text='<%# Bind("EntityName") %>' />
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:DropDownList ID="pEntityProcess_NewEntityList" ClientIDMode="Static" runat="server" Width="100%" 
                                        AutoPostBack="true" OnSelectedIndexChanged="pEntityProcess_NewEntityList_SelectedIndexChanged" CausesValidation="false"  />
                                </FooterTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Process" InsertVisible="False" ItemStyle-HorizontalAlign="Left">
                                <EditItemTemplate>
                                    <asp:DropDownList ID="pEntityProcess_ProcessList" runat="server" Width="100%" />
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="pEntityProcess_ProcessName_lbl" runat="server" Text='<%# Bind("ProcessName") %>' />
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:DropDownList ID="pEntityProcess_NewProcessList" runat="server" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="pEntityProcess_NewProcessList_SelectedIndexChanged"  />
                                </FooterTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

我忘记了什么吗? 非常感谢

0 个答案:

没有答案