drop down menu - How to set a value dynamically for dropdownlist in code behind C# -


i need set value "y" dropdownlist control dynamically.when tried selectedvalue gave error object reference null .plz help

first make sure y there inside asp:dropdownlist. this

if (dropdownlist1.items.findbyvalue("y") != null) {      dropdownlist1.items.findbyvalue("y").selected = true; } 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -