views:

139

answers:

2

I'm using ASP.NET with asp:Label to give my input controls labels.

When my page is in read only mode I disable all my input controls and associated labels.

When I set Enabled="false" on the label it renders as disabled='disabled' which is not valid XHTML strict (a requirement for my project)

Is there a way to disable ASP.NET labels that is XHTML compliant or is this just not a valid thing to do?

A: 

I dont think this is possible by default. You can extend a label control to create a custom control. You can take a user option (e.g. - Enable = false) and write your XHTML complient code to diasble it.

Bhaskar
A: 

Why do you need to disable the labels? Why not just changed them to the disabled color?

Martin