asp.net->取消选中先前选中的单选按钮 [英] asp.net--> to unchecked previously checked radio button
本文介绍了asp.net->取消选中先前选中的单选按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
thanku
anoop
解决方案
Anoop,
您可以将radiobuttonlist.selectedIndex = -1设置为清除选择.
谢谢,
Swapnil.
RadioButtonList
具有方法ClearSelection
.
受保护的 无效 Save_Click(对象发件人,EventArgs e) { sexlist.ClearSelection(); }
这样可以解决您的问题.
hi i have a form which takes user information including its gender. this data is then fed into database. to capture gender i have use radiobutton list with two options either male or female forcing user to select one of them. what i really is is possible to unchecked the selected radiobutton after user information has beem sucessfully caputred. plz provide me with the proper/easy/hint to do the same
thanku
anoop
解决方案
Hi Anoop,
You can set radiobuttonlist.selectedIndex = -1 to clear selection.
Thanks,
Swapnil.
RadioButtonList
has a methodClearSelection
.
protected void Save_Click(object sender, EventArgs e) { genderlist.ClearSelection(); }
This will resolve your issue.
这篇关于asp.net->取消选中先前选中的单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文