문제

I have an .aspx page that works as a PopUp. Sometimes, one RadioButtonList on this PopUp must be enabled, sometimes not. Here is the control :

<acc:RadiobuttonList ID="RadioButton1" runat="server" Font-Bold="true">
  <asp:ListItem Text="Yes" Value="1" />
  <asp:ListItem Text="No" Value="0" />
</acc:RadiobuttonList>

I tried two ways but none worked (even updating the UpdatePanel):

  • RadioButton1.Attributes.Add( "disabled", "disabled" );
  • RadioButton1.Enabled = false;

Only the RadioButtonList is having this behavior (there is another's controls in the page).

What is wrong?

Obs: I noticed that the 'SupportsDisabledAttribute' property of the control is 'false'. This can be influencing in the problem?

도움이 되었습니까?

해결책

The following works fine

RadioButton1.Enabled = false;
RadioButton1.Items[0].Enabled = false;

May I know why is the namespace as acc and not asp

다른 팁

Try RadioButton1.Items(0).Enabled = False... 0 being the index of the button to disable

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top