user3344443 user3344443 - 1 month ago 8
ASP.NET (C#) Question

Disable master control from content page

I tried:

Master.FindControl("dropdownlist2").disabled=true


but it is not working, and I don't want to use
visible=true/false
.

How should I deal with it?

Thanks very much for advice!

Answer

There is no such property as disabled.

Use enabled property and make it false so that the meaning does not get changed and the program would run as you want.

Do it like this:

Master.FindControl("dropdownlist2").Enabled = false
Comments