In ASP.NET 4.0, if we write code as I have reproduced below:
<strong> <asp:Label ID="lblValue" runat="server" Text="Test" Enabled="false"></asp:Label> </strong> <asp:TextBox ID="txtName" runat="server" Enabled="false" Text="HI"></asp:TextBox>
Then it will render it as
<strong> <span id="lblValue">Test</span> </strong> <input name="txtName" type="text" value="HI" id="txtName" disabled="disabled" />
But it will disable the text box Field but not the label field because in ASP.NET 4.0 the Disable property can only Disable input type fields.
So to Disable the fields other than the input type fields we need to add the below line in web.config file
<System.web> <Pages controlRenderingCompatibilityVersion="3.5"> <System.web>
After adding the above line in web.config file the same 2 fields will be render as
<strong> <span id="lblValue" disabled="disabled">Test</span> </strong> <input name="txtName" type="text" value="HI" id="txtName" disabled="disabled" />
Which will disable both the fields