Dim TempC As Control
For Each TempC In Page.Controls
If TempC.GetType().Name = "RequiredFieldValidator" Then
your code
End If
Next
For Each TempC In Page.Controls
If TempC.GetType().Name = "RequiredFieldValidator" Then
your code
End If
Next
调试欢乐多
foreach (Control c in Form1.Controls)
{
if (c.GetType().ToString().IndexOf("RequiredFieldValidator") > 0)
{
// -->> c.Enabled 没有
}
}
代码多,而且没有Enabled属性