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# - SharpSVN - How to get the previous revision? -

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

url - Querystring manipulation of email Address in PHP -