select an item from the dropdown, different than "1"
expected: buttons become enabled
actual: radbutton is still disabled
<asp:Button ID="ButtonTest" runat="server" enabled="true" Text="Test" EnableViewState="False" />
<telerik:RadPushButton ID="RadButtonTest" runat="server" Text="RadButtonTest" Enabled="True" EnableViewState="False" RenderMode="Lightweight"></telerik:RadPushButton>
<asp:DropDownList runat="server" ID="DropDownTest" AutoPostBack="True" OnSelectedIndexChanged="SelectedIndexChanged_Test">
<Items>
<asp:ListItem Text="1" Value="1"></asp:ListItem>
<asp:ListItem Text="2" Value="2"></asp:ListItem>
<asp:ListItem Text="3" Value="3"></asp:ListItem>
<asp:ListItem Text="4" Value="4"></asp:ListItem>
</Items>
</asp:DropDownList>
protected void Page_LoadComplete(object sender, EventArgs e)
{
if (DropDownTest.SelectedValue == "1")
{
ButtonTest.Enabled = false;
RadButtonTest.Enabled = false;
}
else//workaround
{
string script = string.Format("function f(){{$find('{0}').set_enabled({1});Sys.Application.remove_load(f);}}Sys.Application.add_load(f);",
RadButtonTest.ClientID,
"true");
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "someKey", script, true);
}
}
protected void SelectedIndexChanged_Test(object sender, EventArgs e)
{
}