遍历窗体上的控件
2011-07-11 14:45
176 查看
验证用户页面所有的RadioButtonList是否进行了选择
public void ValidateField()
{
for(int i=0;i<Page.Controls.Count;i++)
{
foreach(System.Web.UI.Control control in Page.Controls[i].Controls)
{
if(control is RadioButtonList)
{
if(String.IsNullOrEmpty((control as RadioButtonList).SelectedValue))
{
MessageBox(this.page,"没有填写");
return ;
}
}
}
}
}
public void ValidateField()
{
for(int i=0;i<Page.Controls.Count;i++)
{
foreach(System.Web.UI.Control control in Page.Controls[i].Controls)
{
if(control is RadioButtonList)
{
if(String.IsNullOrEmpty((control as RadioButtonList).SelectedValue))
{
MessageBox(this.page,"没有填写");
return ;
}
}
}
}
}
相关文章推荐
- 如何遍历一个窗体中的某一种控件 c#实现
- 遍历当前窗体下的所有控件
- 遍历窗体上所有CheckBox控件 .net winform
- VS2008 WinForm中通过反射遍历程序中的窗体及窗体上的控件
- 递归遍历窗体控件 设置字体大小FontSize identifierstr hasObjectMethod
- 遍历窗体控件的方法
- 用C#如何遍历一个窗体中的某一种控件
- MFC遍历窗体所有的控件
- 使用EnumChildWindows函数遍历窗体上所有控件
- c#WinForm下窗体权限设计(遍历菜单下的所有菜单及所有form、form中的控件)
- 遍历窗体上所有控件(遍历子控件)
- VC遍历窗体控件的实现
- .Net遍历窗体上控件的方法
- ASP.NET 如何:通过遍历控件集合定位页上的 Web 窗体控件
- QT遍历窗体的控件
- winform 遍历窗体中所有用户控件中的textbox 然后赋为空值
- [Gabriel的专栏] 用C#如何遍历一个窗体中的某一种控件
- 遍历window窗体中控件的方法.
- Vb.net遍历一个窗口中的所有某类对象 (窗体中的控件) 的方法
- 循环遍历窗体控件