Asp.net单选按钮 [英] Asp.net Radio Button
本文介绍了Asp.net单选按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友,我需要您的帮助.我有一个表单,其中包含许多具有不同组名的单选按钮.我需要一个重置按钮来清除所有单选按钮.请帮助我.我不想要JavaScript代码,我正在使用C#语言的Web应用程序.
Hi Friends I need a help from you. I have a form that contain lots of radio button with diffrent group name . i need a reset button to clear all radiobutton . plz help me. i dont want javascript code i am useing c# languge web application.
推荐答案
try:
try:
protected void btnClear_Click(object sender, EventArgs e)
{
//This one call clear method to clear all control values
clear();
}
void clear()
{
foreach (Control c in form1.Controls)
{
//Clear all radio buttons
if (c is RadioButton)
((RadioButton)c).Checked = false;
}
}
检查这些链接..
单选按钮 [ RadioButton [ radiobuttonlist [
check these links..
radiobutton[^]
RadioButton[^]
radiobuttonlist[^]
请参阅此
> http://stackoverflow.com/questions/7025590/clear-all-radio- Buttons-in-a-page [ ^ ]
see this
http://stackoverflow.com/questions/7025590/clear-all-radio-buttons-in-a-page[^]
这篇关于Asp.net单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文