Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
User Security Setup seems to overwrite ReadOnly -propert
Message
De
05/04/2004 12:15:30
 
 
À
01/04/2004 07:22:44
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00890596
Message ID:
00892330
Vues:
16
I was wondering if you or anyone else would have an idea about this dilemma, which is continuation to another question...

[[SNIP]]

Another option I tried is use Enabled instead of ReadOnly. The problem with this (as far as I can tell) is that with Web apps Enabled makes it difficult if not impossible to iterate through the controls that are currently disabled, because they do not show up in the Request.Form.AllKeys -array, which I use to do the looping. If there is another way to loop through all controls on a web form regardless of their Enabled -status, I would be quite happy to use that with Enabled on/off (I tried to figure it out but could not make it happen for some reason...). I guess this would also avoid the whole issue on what is readonly and what is not.

>>>
>>>You should be able to iterate through all the controls by doing something like this:
>>>
>>>
public void GetObjects(Control Container)
>>>{
>>>	// *** Drill through each control on the form
>>>	foreach( Control control in Container.Controls)
>>>	{
>>>		// ** Recursively call down into any containers
>>>		if (control.Controls.Count > 0)
>>>			GetObjects(control);
>>>
>>>		// ** Do your processing here!
>>>	}
>>>}
>>
>>I tried this approach already, but I got the following compile error:
>>'System.ComponentModel.Container' does not contain a definition for 'Controls'
>>
>>Which is no surprise, really, since Intellisense only shows "Equals" and "ReferenceEquals" as available options for the Container -control on the web form.
>>

[[/SNIP]]

So, the question is, why would I not be able to iterate through web form controls like this? Someone suggested another approach (in VB.NET), but it didn't work either, because they were using Item(1) ... Item(2) form objects, which don't seem to be present in my MM.NET based web form.

Thanks.


Pertti
Pertti Karjalainen
Product Manager
Northern Lights Software
Fairfax, CA USA
www.northernlightssoftware.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform