473,385 Members | 1,798 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,385 software developers and data experts.

Disable controls on a page

I have a page that has about 20 textboxes and dropdowns that I want to
disable until a button is pushed.

I don't want them to be hidden which I can do with <div visible=false
runat=serveror <asp:panel visible=false runat=server>. I want them to see
the whole page but just disable all the controls on the bottom 3/4 of the
page.

I could do it by just doing each control one at a time but then if I add or
take a control off the page I would need to remember to enable and disable
it at the proper time.

Thanks,

Tom
Mar 23 '07 #1
4 1560
This code sample is actually for something very different, however, it shows
how to iterate through all your controls - - you can use enabled =
true/false as the outcome

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"tshad" <t@home.comwrote in message
news:eM*************@TK2MSFTNGP02.phx.gbl...
I have a page that has about 20 textboxes and dropdowns that I want to
disable until a button is pushed.

I don't want them to be hidden which I can do with <div visible=false
runat=serveror <asp:panel visible=false runat=server>. I want them to
see
the whole page but just disable all the controls on the bottom 3/4 of the
page.

I could do it by just doing each control one at a time but then if I add
or
take a control off the page I would need to remember to enable and disable
it at the proper time.

Thanks,

Tom


Mar 23 '07 #2
"David Wier" <da********@noSpamhotmail.comwrote in message
news:OA**************@TK2MSFTNGP06.phx.gbl...
This code sample is actually for something very different, however, it
shows
how to iterate through all your controls - - you can use enabled =
true/false as the outcome
Which code sample?

Also, is it in the order of how is displayed on the screen? I want the
first 4 textboxes not be enabled and the rest disabled until I am ready.

Sounds like what I am looking for.

Thanks,

Tom
>
--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"tshad" <t@home.comwrote in message
news:eM*************@TK2MSFTNGP02.phx.gbl...
>I have a page that has about 20 textboxes and dropdowns that I want to
disable until a button is pushed.

I don't want them to be hidden which I can do with <div visible=false
runat=serveror <asp:panel visible=false runat=server>. I want them to
see
>the whole page but just disable all the controls on the bottom 3/4 of the
page.

I could do it by just doing each control one at a time but then if I add
or
>take a control off the page I would need to remember to enable and
disable
it at the proper time.

Thanks,

Tom



Mar 23 '07 #3
Sorry - I totally missed a synapse on that one. Here is the link:
http://aspnet101.com/aspnet/jsSample.../jsSample.aspx

If you want certain ones (in one area) disabled - put them in a panel -
then, expand the iteration so that it iterates through the textboxes in the
panel to enable or disable them

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com

"tshad" <t@home.comwrote in message
news:u0**************@TK2MSFTNGP06.phx.gbl...
"David Wier" <da********@noSpamhotmail.comwrote in message
news:OA**************@TK2MSFTNGP06.phx.gbl...
This code sample is actually for something very different, however, it
shows
how to iterate through all your controls - - you can use enabled =
true/false as the outcome

Which code sample?

Also, is it in the order of how is displayed on the screen? I want the
first 4 textboxes not be enabled and the rest disabled until I am ready.

Sounds like what I am looking for.

Thanks,

Tom

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"tshad" <t@home.comwrote in message
news:eM*************@TK2MSFTNGP02.phx.gbl...
I have a page that has about 20 textboxes and dropdowns that I want to
disable until a button is pushed.

I don't want them to be hidden which I can do with <div visible=false
runat=serveror <asp:panel visible=false runat=server>. I want them
to
see
the whole page but just disable all the controls on the bottom 3/4 of
the
page.

I could do it by just doing each control one at a time but then if I
add
or
take a control off the page I would need to remember to enable and
disable
it at the proper time.

Thanks,

Tom



Mar 23 '07 #4
That's OK. I have a little brain fade myself at least once a day. :)

That was exactly what I was looking for.

Thanks,

Tom
"David Wier" <da********@noSpamhotmail.comwrote in message
news:uB**************@TK2MSFTNGP02.phx.gbl...
Sorry - I totally missed a synapse on that one. Here is the link:
http://aspnet101.com/aspnet/jsSample.../jsSample.aspx

If you want certain ones (in one area) disabled - put them in a panel -
then, expand the iteration so that it iterates through the textboxes in
the
panel to enable or disable them

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com

"tshad" <t@home.comwrote in message
news:u0**************@TK2MSFTNGP06.phx.gbl...
>"David Wier" <da********@noSpamhotmail.comwrote in message
news:OA**************@TK2MSFTNGP06.phx.gbl...
This code sample is actually for something very different, however, it
shows
how to iterate through all your controls - - you can use enabled =
true/false as the outcome

Which code sample?

Also, is it in the order of how is displayed on the screen? I want the
first 4 textboxes not be enabled and the rest disabled until I am ready.

Sounds like what I am looking for.

Thanks,

Tom
>
--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"tshad" <t@home.comwrote in message
news:eM*************@TK2MSFTNGP02.phx.gbl...
I have a page that has about 20 textboxes and dropdowns that I want to
disable until a button is pushed.

I don't want them to be hidden which I can do with <div visible=false
runat=serveror <asp:panel visible=false runat=server>. I want them
to
see
the whole page but just disable all the controls on the bottom 3/4 of
the
>page.

I could do it by just doing each control one at a time but then if I
add
or
take a control off the page I would need to remember to enable and
disable
it at the proper time.

Thanks,

Tom




Mar 23 '07 #5

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: buran | last post by:
Dear ASP.NET Programmers, I have a web user control (a search menu) which has 2 validation controls (one for input and another for the search criterion). I am including this search user control...
6
by: GD | last post by:
Hi, I wonder how to disable the "submit" behavior of a button. What I want is to assign values to dynamically added user controls without page postback. Problem: dynamically created control can...
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...
9
by: junlia | last post by:
Does anyone how how can we disable the auto-postback feature in asp.net page? I have to use a server side control in the page, but the auto post back feature in it causes problems for me. Please...
7
by: Jo Inferis | last post by:
For reasons that are unlikely to become clear at the moment, I have a page with some validation controls on it which opens a dialog. The dialog does *stuff* and then closes with a call to : ...
6
by: | last post by:
hi, how to disable the controls in page? thanks For each myControl in Page.Controls 'want to disable myControl? Next
2
by: Larry | last post by:
Is there a way to disable all the controls the instant any auto-postback controls are changed (resulting in a postback that takes a couple seconds), so that the user can't continue changing other...
4
by: disaia | last post by:
I saw the C# solution: for each Control c in Page.Controls if c is WebControl --((WebControl)c).Enabled = False / true / variable But could figure out the VB syntax. The closest I got was...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
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...
0
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,...
0
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...

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.