Cristiane
July 17th, 2003, 04:41 PM
Hi...
I ask your help for the following problem....
I'm trying to enable/disable buttons in my Page_Load event. I wanna loop among my controls and find the buttons... and if the text property has an x value, enable the button, otherwise, disable the button. That's the code I'm using.... It doesn't work. I have 4 buttons in my page and they aren't any of this "controls" because they don't "enter" in the loop....
Can somebody help me, please? I have no idea what is happening....
Thanks
Cristiane
For Each myControl In Me.Controls
If TypeOf myControl Is Button Then
myBut = CType(myControl, Button)
For i = 0 To dsScreen.Tables(0).Rows.Count - 1
If myBut.Text = dsScreen.Tables(0).Rows(i).Item(1) Then
myBut.Enabled = True
Else
myBut.Enabled = False
End If
Next
End If
Next
:confused:
I ask your help for the following problem....
I'm trying to enable/disable buttons in my Page_Load event. I wanna loop among my controls and find the buttons... and if the text property has an x value, enable the button, otherwise, disable the button. That's the code I'm using.... It doesn't work. I have 4 buttons in my page and they aren't any of this "controls" because they don't "enter" in the loop....
Can somebody help me, please? I have no idea what is happening....
Thanks
Cristiane
For Each myControl In Me.Controls
If TypeOf myControl Is Button Then
myBut = CType(myControl, Button)
For i = 0 To dsScreen.Tables(0).Rows.Count - 1
If myBut.Text = dsScreen.Tables(0).Rows(i).Item(1) Then
myBut.Enabled = True
Else
myBut.Enabled = False
End If
Next
End If
Next
:confused: