更新面板和下拉列表

发布于 2024-08-02 05:16:57 字数 1887 浏览 1 评论 0原文

我有六个 DropDownList,按名称和键对排列。他们的运作方式是,您选择一个渠道合作伙伴,然后过滤并重新绑定总部等等。

到目前为止它工作正常,但我希望能够拥有它,以便每对 DropDownList 都由上面的 DropDownList 触发。我该怎么做?

我考虑过并尝试用 UpdatePanels 包装最后两对,以便只有那些会被触发。但没有太多运气。任何帮助将不胜感激:)

到目前为止的代码是:

<table>
    <tr id="trCP" runat="server">
        <td>Channel Partners</td>
        <td><asp:DropDownList ID="ddlChannelPartners" runat="server" AutoPostBack="True" CssClass="name" OnSelectedIndexChanged="ddlChannelPartners_SelectedIndexChanged" /></td>
        <td><asp:DropDownList ID="ddlChannelPartnersKey" runat="server" AutoPostBack="True" CssClass="code" OnSelectedIndexChanged="ddlChannelPartnersKey_SelectedIndexChanged" /></td>
    </tr>

    <tr>
        <td>Head Companys</td>
        <td><asp:DropDownList ID="ddlHeadCompanies" runat="server" AutoPostBack="True" CssClass="name" OnSelectedIndexChanged="ddlHeadCompanies_SelectedIndexChanged" /></td>
        <td><asp:DropDownList ID="ddlHeadCompaniesKey" runat="server" AutoPostBack="True" CssClass="code" OnSelectedIndexChanged="ddlHeadCompaniesKey_SelectedIndexChanged" /></td>
    </tr>

    <tr>
        <td>Clients</td>
        <td><asp:DropDownList ID="ddlClients" runat="server" AutoPostBack="True" CssClass="name" OnSelectedIndexChanged="ddlClients_SelectedIndexChanged" /></td>
        <td><asp:DropDownList ID="ddlClientsKey" runat="server" AutoPostBack="True" CssClass="code" OnSelectedIndexChanged="ddlClientsKey_SelectedIndexChanged" /></td>
    </tr> 

    <tr>
        <td colspan="3">
            <asp:Button ID="btnOK" runat="server" UseSubmitBehavior="true" Text="OK" OnClick="btnOK_Click" />
        </td>
    </tr>
</table>

I have six DropDownLists arranged in pairs Name and Key. They operate in the sense of you choose a Channel Partner and then that filters down and rebinds the Head Office and so forth.

It works fine so far but I want to be able to have it so that each pair of DropDownLists are triggered by the ones above. How would I do this?

I have thought about and tried wrapping the last two pairs with UpdatePanels so that only those would be triggered. But haven't had much luck. Any help would be greatly appreciated :)

the code so far is:

<table>
    <tr id="trCP" runat="server">
        <td>Channel Partners</td>
        <td><asp:DropDownList ID="ddlChannelPartners" runat="server" AutoPostBack="True" CssClass="name" OnSelectedIndexChanged="ddlChannelPartners_SelectedIndexChanged" /></td>
        <td><asp:DropDownList ID="ddlChannelPartnersKey" runat="server" AutoPostBack="True" CssClass="code" OnSelectedIndexChanged="ddlChannelPartnersKey_SelectedIndexChanged" /></td>
    </tr>

    <tr>
        <td>Head Companys</td>
        <td><asp:DropDownList ID="ddlHeadCompanies" runat="server" AutoPostBack="True" CssClass="name" OnSelectedIndexChanged="ddlHeadCompanies_SelectedIndexChanged" /></td>
        <td><asp:DropDownList ID="ddlHeadCompaniesKey" runat="server" AutoPostBack="True" CssClass="code" OnSelectedIndexChanged="ddlHeadCompaniesKey_SelectedIndexChanged" /></td>
    </tr>

    <tr>
        <td>Clients</td>
        <td><asp:DropDownList ID="ddlClients" runat="server" AutoPostBack="True" CssClass="name" OnSelectedIndexChanged="ddlClients_SelectedIndexChanged" /></td>
        <td><asp:DropDownList ID="ddlClientsKey" runat="server" AutoPostBack="True" CssClass="code" OnSelectedIndexChanged="ddlClientsKey_SelectedIndexChanged" /></td>
    </tr> 

    <tr>
        <td colspan="3">
            <asp:Button ID="btnOK" runat="server" UseSubmitBehavior="true" Text="OK" OnClick="btnOK_Click" />
        </td>
    </tr>
</table>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

影子的影子 2024-08-09 05:16:57
  1. AJAXControlToolkit 中的 CascadingDropDown 很好地解决了同样的问题。好吧,也许这不是你的方式。
  2. 将对放置在单独的 UpdatePanel 中
  1. There is good implmentation of same problem over CascadingDropDown in AJAXControlToolkit. Ok may be it is not your way.
  2. Place pairs in separate UpdatePanels
唯憾梦倾城 2024-08-09 05:16:57

您见过 AjaxControlToolkit 中的 CascadingDropDown 吗?我认为这会做很多你想要的事情。

Have you seen the CascadingDropDown in the AjaxControlToolkit? I think that'll do a lot of what you want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文