问题描述
尊敬的先生,
我有3个下拉列表. 1st包含大陆.第二个包含国家.第三名包含城市.
我想首先选择一个大陆.当我选择大陆时,我需要在国家/地区下拉列表中选择国家/地区.当我选择一个国家/地区时,受人尊敬的城市将出现在城市下拉列表中.
我已经正确地做了所有这些.但是我的问题是,当我选择一个大陆时,页面会刷新,这需要很长时间.
请给我一些小例子的帮助.
先生,请同时提供带有ajax下拉菜单的解决方案.
谢谢.
Manoj joshi
Dear sir,
I have 3 dropdown lists. 1st contains the continental. 2nd contains country. 3rd contains city.
i want to choose first a continent. when i choose continent i need country in in country dropdown. and when i choose a country a respected city will came in city dropdown list.
i have done all of these correctly. but my problem is when i am selecting a continent my page goes to refresh and it''s taking a long time.
please provide me some help with the a little example.
sir please provide solution with ajax dropdown also.
thanking you.
Manoj joshi
推荐答案
<updatepanel id="UpdatePanel1" runat="server">
<contenttemplate>
</contenttemplate>
</updatepanel>
<asp:DropDownList ID="continental" runat="server" OnSelectedIndexChanged="taha"></asp:DropDownList>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="country" runat="server"></asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="continental" EventName="taha"/>
</Triggers>
</asp:UpdatePanel>
只需将要更新的内容放在ContentTemplate中的回调中即可.
并将触发器的controlID设置为导致回发事件的控件ID!
just put the content that update in call back in ContentTemplate.
and set the controlID of your trigger to ID of control that causes the postback event!
这篇关于与下拉列表相关的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!