Click here to Skip to main content
15,923,164 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a dropdownlist with auto search and there are a button when click on that button another dropdownlist creating dynamically. and i want to disable it based on some condition.

after generating dropdownlist it generate span




What I have tried:

i have tried ddlBrand0.Enable=false
but it not working

Please help me
Posted
Updated 12-Oct-17 20:38pm
v2
Comments
Andy Lanng 12-Oct-17 10:26am    
Can you show us your whole code, please. Most likely the issue is when and how you disable the ddl

1 solution

If you are creating dropdown in code behind and want to disable it in code behind only, then you should use "Enabled" property and set it to false.

ddlBrand0.Enabled=false


And if you are trying to disable it from JavaScript then do the following.

document.getElementById("clientdropdownid").disabled = true;
 
Share this answer
 
Comments
Aniruddha Tewary 16-Oct-17 2:14am    
I have tried this but still not working..

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