B
Bogdan Zamfir
Hi,
I want to process all controls on a page, to check for a specific attribute
(a specific custom attribute I added).
I try with the following code
Dim oCtrl As WebControls.WebControl
For Each oCtrl In Page.Controls
If oCtrl.Attributes("bzDisable") = "1" Then
oCtrl.Enabled = false
End If
Next
bzDisable is a custom attribute I added to Textbox control in .ASPX page
and it gives me this error:
Exception Details: System.InvalidCastException: Specified cast is not valid.
Can anyone tell me what I did wrong?
Thank you.
Bogdan
I want to process all controls on a page, to check for a specific attribute
(a specific custom attribute I added).
I try with the following code
Dim oCtrl As WebControls.WebControl
For Each oCtrl In Page.Controls
If oCtrl.Attributes("bzDisable") = "1" Then
oCtrl.Enabled = false
End If
Next
bzDisable is a custom attribute I added to Textbox control in .ASPX page
and it gives me this error:
Exception Details: System.InvalidCastException: Specified cast is not valid.
Can anyone tell me what I did wrong?
Thank you.
Bogdan