选择值后,下拉菜单消失. [英] dropdown dissapear after value selected.

查看:90
本文介绍了选择值后,下拉菜单消失.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一种情况,当用户从第一个下拉列表中选择值,然后根据从第一个下拉列表中选择的值出现第二个下拉列表中的项目.最后,在选择第二个下拉列表中的值之后,表单将出现.
我的问题是,每当用户完成选择第二个下拉菜单时,第二个下拉菜单都消失了,但是表格在那里.

帮助我.我必须提交此项目 asap :(

thanx



i have a situation when user select value from 1st dropdownlist then item in 2nd dropdown list appear according to the selected value from the first.lastly the form will appear after value in 2nd dropdown is selected.

my problem is whenever user finish select the 2nd dropdown, the 2nd dropdown is dissapear but the form is there.

help me.i have to submit this project asap :(

thanx

推荐答案

在发生任何事件后在页面上触发page_load时,则dropdownlist2不可见.因此请检查以下条件:
When page_load fire on page after any event then dropdownlist2 is not visible. so check through condition under :
 protected void Page_Load(object sender, EventArgs e)
    {
if (dropdownlist2.SelectedIndex!=0)
     dropdownlist2.visible=true;
else
     dropdownlist2.visible=false;

}



经历这个.希望对您有帮助.
如果有帮助,请不要忘记将其标记为答案. :)



go through this. Hope this will help you.
Don''t forget to mark as answer if it helps. :)


似乎默认情况下隐藏了dropdown2(可能在page_load上),并且当用户在dropdown1中选择一个项目时显示dropdown2.

检查您是否具有隐藏页面加载中dropdown2的代码,但没有if(!IsPostBack){}.

共享您的代码以获得适当的解决方案.
It looks like you are hiding the dropdown2 on by default (may be on page_load) and show the dropdown2 when user selects an item in dropdown1.

Check whether you have the code to hide the dropdown2 in pageload but outof if(!IsPostBack){}.

Share your code to get the appropiate solution.


由于您没有提供代码,因此很难确定问题出在哪里.我为您提供了一些不错的链接,以使您更好地了解您需要做什么.请通过以下链接:

CascadingDropDown演示
将CascadingDropDown与数据库一起使用
根据对其他下拉ASP.NET的选择来填充级联DropDownList
如何根据其他下拉列表或级联来填充下拉列表asp.net中的下拉列表
使用Asp.net数据库的Ajax级联下拉列表示例

每个链接都将指导您实现Cascading DropDown.
As you didn''t provide your code it is very difficult to identify where is your problem. I am providing you some nice links for your better understanding what you need to do. Please go through the following links:

CascadingDropDown Demonstration
Using CascadingDropDown with a Database
Populate Cascading DropDownList based on selection of other dropdown ASP.NET
how to populate dropdown based on other dropdown or working with cascading dropdowns in asp.net
Ajax Cascading Dropdownlist Sample with database using asp.net

Every single link will guide you to implement Cascading DropDown.


这篇关于选择值后,下拉菜单消失.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆