Enabling/diusabling child controls

S

Summit

Hi,

I have got a child control within a parent control. If i disable my child
control but enable my parent control , does it cause the pchild control to
stay enabled?

Example:- I have got a checkboxlist web control within a table control and I
have set the Enabled property to false but the table is Enabled. This is
causing my checkboxlist control to stay enabled.

Any suggestions?

Regards,
Summit
 
A

Axel Dahmen

Are you using .NET framework 1.0? And are you testing this with a browser
other than IE?

The .NET framework 1.0 has a know bug in the CheckBoxList control which
seems to have been fixed in 1.1.

HTH,
Axel Dahmen
 
S

Summit

No,

I am using .NEt 1.1 . Maybe I should elaborate on what I am doing.

I have got a checkboxlist control which I place it in a table control(for
indenting).

If I set my enabled property of the checkboxlist control to false, but leave
the table cntrol to disabled= false, it keeps the checkboxlist control to
enabled. So that fact that I am trying to disable my checkboxlist has got
absolutely no effect on it.

I had a look at the html that it renders and I could see no signs of any
"diabled" property being set.

However, if I set the table.Enabled property(which is hosting the
checkboxlist ) to false, it disables the checkboxlist control.

Any idea what's going on here?

Regards,
Summit
 
A

Axel Dahmen

Ah, I see... so you are using CLIENT-side HTML for the table and SERVER-side
controls for the Checkboxlist... If that is the case, you have made two
mistakes:

First, a HTML table element doesn't actually have a "disabled" attribute as
it is not an input element. So, in fact, what you did is having created
invalid HTML.

Next, the Enabled property of server-side controls is solely interpreted by
ASP.NET and used when rendering controls into HTML. BUT to have ASP.NET
consider the table's Enabled property, this table has to be declared having
the Runat attribute set to "server". After doing that you need to set the
Enabled property in code, as still the HTML table element doesn't provide an
Enabled property, yet the associated C#/VB object does.

Keep me informed if you have any questions left.

HTH,
Axel Dahmen

-----------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,813
Messages
2,569,700
Members
45,491
Latest member
JennyPerso

Latest Threads

Top