Click here to Skip to main content
16,015,926 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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();
}
Posted
Updated 28-Jul-16 5:35am
Comments

1 solution

Hi friend,
In design set properties Enabled="false". Below link help to you.
Creating Cascading DropDownLists in ASP.Net[^]
 
Share this answer
 
Comments
Member 12652110 28-Jul-16 12:08pm    
Whenn i click on car, few values will show up in second dropdownlist.
But when i click on select, second dropdownlist sholud be disabled but so far no luck
[no name] 28-Jul-16 12:43pm    
Hi you can do disable "onchange" event using JQuery. I will send example.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900