473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

control disable

hi, how to disable the controls in page? thanks

For each myControl in Page.Controls
'want to disable myControl?
Next
Feb 13 '06 #1
6 1501
js@someone.com wrote:
hi, how to disable the controls in page? thanks

For each myControl in Page.Controls
'want to disable myControl?
Next


For each myControl in Page.Controls
'want to disable myControl?
myControl.Enabled = False
Next
Feb 13 '06 #2
js,

Have a look at the uper part of this sample.

http://www.vb-tips.com/default.aspx?...6-56e3599238c1

and than instead of that addhanlder

ctr.enabled = false

However in this is probably
me.enabled = false

easier.

Cor
Feb 13 '06 #3
js
Hi,
I got compile error: "Enable" is not a membre of "System.Web.UI.Control",

Dim myControl as Control
For each myControl in Page.Controls
'want to disable myControl?
myControl.Enabled = False
Next

How to fix it? Thanks.

"Chris" <no@spam.com> wrote in message
news:eq**************@TK2MSFTNGP11.phx.gbl...
js@someone.com wrote:
hi, how to disable the controls in page? thanks

For each myControl in Page.Controls
'want to disable myControl?
Next


For each myControl in Page.Controls
'want to disable myControl?
myControl.Enabled = False
Next

Feb 13 '06 #4
Hi Js,

Instead of declaring myControl as Control, try declaring it as WebControl
(System.Web.UI.WebControls.WebControl). This class possesses the "Enabled"
property. This of course, assumes that you have only WebControls on your
page, and not HtmlControls etc. Also, not all WebControls support this
property, so you would have to be careful about what all you have on the
page. An alternative may be to put all the controls you want to disable,
into a Panel control and then use "For each myControl in Panel1.Controls"..

The code would then be :
------------------------
Dim myControl as WebControl
For each myControl in Page.Controls
myControl.Enabled = False
Next
------------------------

Hope this helps...

Regards,
Cerebrus.
"js" <js@someone.com> wrote in message
news:Ok*************@TK2MSFTNGP10.phx.gbl...
Hi,
I got compile error: "Enable" is not a membre of "System.Web.UI.Control",

Dim myControl as Control
For each myControl in Page.Controls
'want to disable myControl?
myControl.Enabled = False
Next

How to fix it? Thanks.

"Chris" <no@spam.com> wrote in message
news:eq**************@TK2MSFTNGP11.phx.gbl...
js@someone.com wrote:
hi, how to disable the controls in page? thanks

For each myControl in Page.Controls
'want to disable myControl?
Next


For each myControl in Page.Controls
'want to disable myControl?
myControl.Enabled = False
Next


Feb 13 '06 #5
Js,

I see now that it is a webform, that is this tip.

http://www.vb-tips.com/default.aspx?...8-ec5d24c916a6

And than the same as I wrote in the previous message.

Sorry, I did not see it direct,

I hope this helps,

Cor
Feb 13 '06 #6
js
Thanks Cor.

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:ue*************@TK2MSFTNGP09.phx.gbl...
Js,

I see now that it is a webform, that is this tip.

http://www.vb-tips.com/default.aspx?...8-ec5d24c916a6

And than the same as I wrote in the previous message.

Sorry, I did not see it direct,

I hope this helps,

Cor

Feb 13 '06 #7

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

Similar topics

4
by: Phil | last post by:
Hello all, Can anybody give me any ideas on how to disable a tab page within a tab control. I have a tab control tabClients with 3 pages. I would like to disable pages 2 & 3 when a certain...
2
by: Eric | last post by:
I'm trying to dynamically load a user control using on the .NET framework (not Visual Studio). The control was designed in Visual Studio and is named: Disable.ascx The first line is: <%@...
1
by: Lisa Calla | last post by:
Hi, I have a composite control made of a textbox and a label. I want to show either the textbox or the label, and hide the other control on the client side in response to a click. I can run a...
0
by: David | last post by:
Hi, If I put the dropdown control in a panel control, after I disable the container--panel control, I can still drop down the dropdown control. How can I disable a dropdown in a container? ...
0
by: Robert Ladd | last post by:
Hi, I'm trying to disable the asp.net calendar control from a javascript function, but it doesn't disable the doPostBack. To simplify the situation, assume a page with 4 controls. A...
1
by: AndrewR | last post by:
Hey all, Have a strange one here I don't understand.... I have a DataList control in an .aspx page. Inside the DataList's <ItemTemplate> is a single LinkButton control. On the initial page...
2
by: Andre Ranieri | last post by:
I'm retouching our corporate web site that, among other things, allows customers to log in and pay their invoices online. I noticed that on the checkout page, the credit card number textbox...
0
by: Kumar R | last post by:
How to disable the specific date in the DateTimePicker control. suppose i want to disable all sundays and saturdays of the particular month. how to do? i search in the many sites, but i didn't find...
0
by: esakal | last post by:
Hello, I'm using .net 2 C#. I would like to change the layout of the Disable so it will looks like it is enable but the user will not be able to focus on the control nor entring him with...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.