Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make all my page controls read only in one go
Message
From
25/03/2004 10:17:35
 
 
To
All
General information
Forum:
ASP.NET
Category:
Web forms
Title:
How to make all my page controls read only in one go
Miscellaneous
Thread ID:
00889604
Message ID:
00889604
Views:
62
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
Next
Reply
Map
View

Click here to load this message in the networking platform