473,473 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

easy one again!

Hello

I've an asp.net page that, of course, has serveral
buttons,
text boxes and other kind of controls in it...

i need now to have them all disabled, or a lot of them,
and i'm searching for the best/elegant way to do it...

i managed to create a for cycle to iterate all the page's
form's controls
but usign page.controls.item(x) i can't find the enabled
property... only visible one...

how can i do this?!?!
how can i disable a bunch of controls using a for next
command instead of doing it one by one?!?!

best regards

JR
Nov 17 '05 #1
2 1041
If all your controls are web controls (have WebControl class as a base class
somewhere in the inheritence hierarchy), you can cast it to WebControl in
your loop, and have access to the Enabled property.

"Jorge Ribeiro" <jo***********@irsocial.mj.pt> wrote in message
news:04****************************@phx.gbl...
Hello

I've an asp.net page that, of course, has serveral
buttons,
text boxes and other kind of controls in it...

i need now to have them all disabled, or a lot of them,
and i'm searching for the best/elegant way to do it...

i managed to create a for cycle to iterate all the page's
form's controls
but usign page.controls.item(x) i can't find the enabled
property... only visible one...

how can i do this?!?!
how can i disable a bunch of controls using a for next
command instead of doing it one by one?!?!

best regards

JR

Nov 17 '05 #2
If all your controls are web controls (have WebControl class as a base class
somewhere in the inheritence hierarchy), you can cast it to WebControl in
your loop, and have access to the Enabled property.

"Jorge Ribeiro" <jo***********@irsocial.mj.pt> wrote in message
news:04****************************@phx.gbl...
Hello

I've an asp.net page that, of course, has serveral
buttons,
text boxes and other kind of controls in it...

i need now to have them all disabled, or a lot of them,
and i'm searching for the best/elegant way to do it...

i managed to create a for cycle to iterate all the page's
form's controls
but usign page.controls.item(x) i can't find the enabled
property... only visible one...

how can i do this?!?!
how can i disable a bunch of controls using a for next
command instead of doing it one by one?!?!

best regards

JR

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: JW | last post by:
I'm displaying product thumbnails with brief descriptions on web pages. Clicking on the product does a javascript popup with larger image and detailed description info passed to the javascript...
6
by: Johnathan Doe | last post by:
Hi, I'm looking for an easy way to do web development with Python (session handling a-la ASP/JSP/PHP, that kind of thing). I've looked at PythonWeb.org but it has bugs because it's not tested on...
3
by: Oliver Bryant | last post by:
I just finished developing a javascipt component allowing floating captions to appear over HTML elements. If anyone wants to check it out you can see specs and download it from...
3
by: Jason | last post by:
I'm using asp.net to create a staff directory based on Active Directory, and I'm sure this is an easy question, but I can't seem to find anything about it in the newsgroups: I know it's possible...
1
by: melanieab | last post by:
Hi, If there's a textbox and the text entered is longer than what's visible (the textbox length), how do you make it so that the beginning chunk of text is visible (instead of the last part of...
23
by: **Developer** | last post by:
Is there an easy way to copies all files in a directory into another directory? What about coping subdirectories too? Thanks in advance for any info
4
by: n | last post by:
Hello! Here is a problem I hope you can point me to a solution. It Problem: A teacher needs to know which lesson to teach. A school has a curriculum with 26 lessons, A-Z. For a given class,...
15
by: Dan2kx | last post by:
Hello again, (seems i'm posting here alot right now) I have another problem.... I have an "addstaff" form, and i want to capture the ID from that form (before it closes) and use it on a newly...
4
by: Rick Stevens | last post by:
I am not an access expert, could anyone tell me if the following would be easy to do?? I receive emails from a specific email address, that advise me if a specific piece of equipment my company...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.