自定义一个有四个radiobutton的用户控件 使用循环绑定数据后放进panel里 想要使用户控件的四个radiobutton必须选择一个 如果不选的话提示选择 请问该怎么解决?
解决方案 »
- 修改图片后,必须手动刷新才显示新图片的问题
- 安装了.net之后 什么类型的文件可以被执行??
- 我有个程序循环执行SqlCommand,那这时候的SqlConnection每次都要open一下然后在close一下???这样会产生问题莫?
- 怎么动态的显示错误信息?
- 怎样取用户控件中的DropDownList值
- 如何给RadioButtonList控件赋值啊
- 如何设置本页,让自己在以运行就变成没有toolbar,location,status,menubar,titlebar样式的窗体呢?
- 添加多条记录时出了点问题,请哥哥、姐姐们帮一把。
- C# Active 控件 求大神指点
- 如何使DataGrid在查询之前就显示表头的内容??
- 回娘家问两条SQL语句
- 公司试用期的考试题目请教
protected void Button1_Click(object sender, EventArgs e)
{
Panel p =this.FindControl("Panel1") as Panel; int i=0;
foreach( Control c in p.Controls )
{
if (c is RadioButton)
{
if ((c as RadioButton).Checked == true)
{
i++;
}
}
}
if (i == 0)
{
Response.Write("<script>alert('没有选择')</script>");
return;
}
}
或用radiobuttonlist遍历判断是否选择
或在用户控件中遍历控件是否选择
RadioButton rdb= uc.FindControl("RadioButton1") as RadioButton;
不知道可不可行 最好是用验证控件 希望大家多帮我想想 谢谢了