Edwin,
Only ASP.NET server controls contain the Enabled property. If you are using
all server side controls, you can do the following:
<body>
<form id="form1" runat="server">
<div>
<asp:PlaceHolder ID="PlaceHolder1" runat="server">
<asp:TextBox ID="TextBox1" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Button" />
</asp:PlaceHolder>
</div>
</form>
</body>
in code:
foreach (WebControl control in PlaceHolder1.Controls)
{
control.Enabled = false;
}
If you attempt to use this with an HTML control such as an <IMG> or <INPUT>
tag, you will throw an InvalidCastException.
Hope this helps.
--
Andrew Robinson
http://blog.binaryocean.com
"Edwin Knoppert" <ne**@hellobasic.com> wrote in message
news:43***********************@text.nova.planet.nl ...
I did the same, like i said, visible does work, disabling instead.. how?
"Andrew Robinson" <ne****@nospam.nospam> schreef in bericht
news:%2****************@TK2MSFTNGP10.phx.gbl... You can use a container control or make the div a server side control:
<body>
<form id="form1" runat="server">
<div id="div1" runat="server">
<asp:TextBox ID="TextBox1" runat="server" />
<asp:Button ID="Button1" runat="server" />
</div>
</form>
</body>
div1.Visible = false;
--
Andrew Robinson
http://blog.binaryocean.com
"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dr**********@azure.qinip.net...I have a div which holds controls.
I'm looking for a way to disable all controls but *without* setting each
control enable state.
Same to style>display i'm looking for a disable method.
Do i need a container control for this?