I am getting error while implement this supposedly very simple looking sceanrio using 2 radbutton.
I have 2 rad buttons on the form as below.
- First I wanted to set the property visiblity to false to one of them based on the session variable set.
- & then alternate the visiblity between the 2 rad buttons when either one is clicked.
The problem is as below. When I set the visiblity=false on click of one button. It works first time. On the next click (of the current visible button),I recieve an error, returns a null error while trying to make the previously made invisible buttom visible.
<
telerik:RadButton
ID
=
"rb1"
runat
=
"server"
skin
=
"Vista"
Text
=
"Switch to 2"
OnClientClicking
=
"OnClick_1"
OnClick
=
"OnClicked_1"
GroupName
=
"GroupName1"
ButtonType
=
"ToggleButton"
Visible
=
"false"
>
</
telerik:RadButton
>
<
telerik:RadButton
ID
=
"rb2"
runat
=
"server"
skin
=
"Vista"
Text
=
"Switch to 1"
OnClientClicking
=
"OnClick_2"
OnClick
=
"OnClicked_2"
GroupName
=
"GroupName1"
ButtonType
=
"ToggleButton"
>
</
telerik:RadButton
>
var radButton1 = $find("rb1");
radButton1.set_visible(false);
var radButton2 = $find("rb2");
radButton1.set_visible(true);
Note: There is a another conditional snippet which sets rb1 visiblity to false & rb2 to true.
here rb2 is throwing null (because its visiblity is already set to false), the reason why throwign errror while setting the visibility to true.
Thank you