本文介绍了在下拉列表中设置值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在asp.net网站上工作.在页面加载中,我使用所有国家/地区名称填充国家/地区下拉列表.之后,我有一个搜索面板.
在这种情况下,当我选择一个用户名时.然后我要在下拉列表中选择用户的国家/地区名称.
所以给我一个主意,我该怎么做?
请给我任何链接或任何解决方案.
Hello Every One,
I am working in asp.net website. On Page load i am filling country dropdownlist with all countries name. after that i have a search panel.
in this when i select a username. then i want to select user''s country name in dropdownlist.
so give me any idea how can i do this?
please give me any link or any solution.
推荐答案
ddlCountry.SelectedIndex = ddlCountry.Items.IndexOf(ddlCountry.Items.FindByValue(countryname));
国家名是我要在下拉列表中设置的值.
countryname is value which i want to set in dropdownlist.
这篇关于在下拉列表中设置值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!