如何进行下拉列表控制,如果我重新加载页面,下拉列表应该从开始开始? [英] How To Make A Drop Down List Control, If I Reload The Page, The Drop Down List Should Start From Begining ?
本文介绍了如何进行下拉列表控制,如果我重新加载页面,下拉列表应该从开始开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好......
任何人都可以告诉我???
喜欢,当我重新上传页面时,如果我需要任何文本框应该变成空白,我使用做textbox1.Text =;它变得空白......
相同。我想,如果我重新上传页面,下拉列表应该从其初始值或列表中的第一个值开始显示???
提前感谢...
hello...
can any body tell me ???
like, when i relode the page, if i need any textbox should become blank, i use to do textbox1.Text=""; and it become blank...
same as. i want, if i relode the page, drop down list should start showing from its initial value or the first value in list ???
thanks in advance...
推荐答案
我认为这个解决方案可能适用于你..set DropDownList
I think this solution might work for you..set DropDownList
ViewStateMode="Disabled"
您应该指定SelectedIndex
或的SelectedValue
。第一个是最简单的...
You should assign theSelectedIndex
orSelectedValue
. First one is the easiest...
ddlYourDropDownList.SelectedIndex = 0;
因此,它只会在第一个索引处选择项目,通常我们在那里有一个默认项目选择。
So, it will just select the item at the first index, usually we have an default item "Select" over there.
这篇关于如何进行下拉列表控制,如果我重新加载页面,下拉列表应该从开始开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文