Mark,
You can use reflection to determine if the control has a ReadOnly/Enabled property. Have a look at the System.Reflection namespace or GetProperty(ies?) method in the help file. I'm sorry that I can't be more specific, I don't have access to VS.NET at the moment.
>I have a VB Data Entry Web form
>
>I need to switch most of the controls on this to read only under program control.
>
>I can write code set each controls enabled property to false one at a time, but this seems a PITA to do for every form I write.
>
>I need to be able to say make everything disabled apart from .........
>
>I started with the following and then got stuck because the enabled property is not available for all objects.
>
>I assume I have to make my code more specific using gettype, but I have no idea how to do this and I can find no examples on the web.
>
>Can someone get me started
>Many thanks
>
>
>
>
> Dim item As System.Web.UI.Control
>
>
> With Me.Controls
>
> For Each item In Me.Controls
>
> ' At this point I discovered there was no enable property I could set
>
> Dim mytype As String = item.GetType.ToString
>
>
> Next
>
>
>
>