如何在下拉列表中选择文本时禁用另一个下拉列表? [英] How to disable another dropdown list when text is select in a dropdownlist?

查看:89
本文介绍了如何在下拉列表中选择文本时禁用另一个下拉列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于select是供客户选择值,我希望第二个下拉列表无法点击



我尝试过:



DdlTerm.Enabled = false;

DdlTerm.Items.Clear();







if(DDlLoanType.Text!=选择)

{


string query = string.Format(选择LoanTerm,来自LoanRates的LoanRate,其中LoanType ='+ DDlLoanType.Text +');

BindDropDownList(DdlTerm,query,LoanTerm ,LoanRate,选择);

DdlTerm.Enabled = true;

}

其他

{



DdlTerm.Enabled = false;

DdlTerm.Items.Clear();

}

解决方案

嗨朋友,

在设计集属性中Enabled =false。以下链接可为您提供帮助。

创建级联DropDownLists ASP.Net [ ^ ]

As select is for customers to select values, I want the second dropdown list to be unclickable

What I have tried:

DdlTerm.Enabled = false;
DdlTerm.Items.Clear();



if (DDlLoanType.Text != "Select")
{

string query = string.Format("select LoanTerm, LoanRate from LoanRates where LoanType = '" + DDlLoanType.Text + "'");
BindDropDownList(DdlTerm, query, "LoanTerm", "LoanRate", "Select");
DdlTerm.Enabled = true;
}
else
{

DdlTerm.Enabled = false;
DdlTerm.Items.Clear();
}

解决方案

Hi friend,
In design set properties Enabled="false". Below link help to you.
Creating Cascading DropDownLists in ASP.Net[^]


这篇关于如何在下拉列表中选择文本时禁用另一个下拉列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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