Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > How Do I set enabled to false on all but one web control on a page

Thread Tools

How Do I set enabled to false on all but one web control on a page

Karen Grube
Posts: n/a

What I need to do is loop through all the web controls on a page where
the tabindex is > 6 and set enabled to false.

I've got about 60 controls on a page and would rather not have to set
each one individually. Any suggestions? Here's a snippet of code I found
and tried to modify but it doesn't work. I know this is wrong (incomplete) ,
but I'm not sure how to get to the value of the tabindex property, test it,
and then set the enabled property on that control.

Dim control As Control
Dim t As System.Type
For Each control In Page.Controls
t = control.GetType().GetProperty
If t = 1 Then
CType(control, TextBox).Enabled = False
End If

Karen Grube Removed)

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Set Enabled to false for multiple web controls elaine ASP .Net 2 05-24-2007 08:13 AM
False positive, false intrusion, false alarm Nick Computer Security 3 04-26-2006 07:40 PM
Enabled set to false but still able to use datagrid Dave E ASP .Net Datagrid Control 1 02-15-2005 05:49 AM
Setting the web control textbox property enabled = FALSE Gill Smith ASP .Net 4 05-22-2004 08:20 PM