如何清除或重置usercontrol下拉项。 [英] How to clear or reset usercontrol dropdown items.
本文介绍了如何清除或重置usercontrol下拉项。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨专家,
Hi experts,
I have a UserControl with two dropdowns. course and subcourse.
in my aspx page i am using usercontrol. when i save details and clear controls data
or reset that time i want to reset UserControl dropdowns selected item as default
e.g. --Select Course--
and --Select Sub-course--
请给我一个解决方案。
提前使用。
please give me a solution for this.
thanx in advance.
推荐答案
在用户控制中创建重置功能
添加此行以选择您拥有的任何物品的价值。
ddl.SelectedValue =2;
Create a reset function in user control
add this line to select whatever the value of item you have.
ddl.SelectedValue = "2";
这篇关于如何清除或重置usercontrol下拉项。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文