473,662 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1514
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.Enabl ed = 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.Enabl ed = False
Next

How to fix it? Thanks.

"Chris" <no@spam.com> wrote in message
news:eq******** ******@TK2MSFTN GP11.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.Enabl ed = False
Next

Feb 13 '06 #4
Hi Js,

Instead of declaring myControl as Control, try declaring it as WebControl
(System.Web.UI. WebControls.Web Control). 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.Enabl ed = False
Next
------------------------

Hope this helps...

Regards,
Cerebrus.
"js" <js@someone.com > wrote in message
news:Ok******** *****@TK2MSFTNG P10.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.Enabl ed = False
Next

How to fix it? Thanks.

"Chris" <no@spam.com> wrote in message
news:eq******** ******@TK2MSFTN GP11.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.Enabl ed = 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******** *****@TK2MSFTNG P09.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
11680
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 condition is met. Thanks in Advance. Phil.
2
2451
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: <%@ Control Language="c#" className="Disable1" src="Disable.ascx.cs" %> The host page for this control is named UserControl.aspx. The first 2 lines are: <%@ Reference control="Disable.ascx" %>
1
2356
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 function belonging to the control, but I can't seem to alter the visibility of the children. My composite control has this client-side code: function disable() { alert('In disable'); document.getElementById("TextBox1").style.display="none";...
0
861
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? Thank you! David
0
3360
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 dropdownlist, a calendar control, a textbox and an update button. What I'm doing is initially setting the button to disabled, the other 3 controls are enabled. If any data is entered in the textbox, I want to disable the dropdownlist and the calendar...
1
2221
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 load-up I bind the DataList, and set the LinkButton's text and CommandArgument values to the two items in the result set using the <%# ... %> tags. The LinkButton's OnClick handler is set to a sub call ShowScores. When the page is run, I get on...
2
2698
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 autofills with past entries for that textbox. My development workstation has the Google Toolbar installed; I'm not sure whether the autofill functionality is native to the browser or coming from the Google Toolbar. In either case, is there any way...
0
2105
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 any solution for disable the date in DateTimePicker control. Thanks in advance. R Kumar =======
0
1222
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 keyboard, mouse or by code.
0
8432
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8343
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8762
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8545
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4179
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.