I have nested RadMenuItems hard coded in an aspx file with 3 different but similar menus. Under a certain condition I need to remove the second menu item in each menu which works fine in the Visual Studio 2013 test environment. When I deploy to GoDaddy, remove on the third menu does not work in Page_Load.
GoDaddy the items in the third menu in the aspx file are not fully instantiated in Page_Load.
I was forced to code to check if the hard coded menu items exist and abandon the remove to avoid run-time errors.
if (JoinButtonMenu.Items.Count > 2 && JoinButtonMenu.Items.Count > 2) {
JoinButtonMenu.Items[1].Items[1].Remove();
}
<
telerik:RadContextMenu
ID
=
"JoinButtonMenu"
CssClass
=
"RadContextMenu3"
runat
=
"server"
>
<
ExpandAnimation
Type
=
"None"
Duration
=
"0"
/>
<
CollapseAnimation
Type
=
"None"
Duration
=
"0"
/>
<
Items
>
<
telerik:RadMenuItem
Text
=
"Edit"
NavigateUrl
=
"javascript:MenuItemSelected('Edit');"
PostBack
=
"False"
></
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"Insert"
PostBack
=
"False"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"Insert Display Text..."
NavigateUrl
=
"javascript:MenuItemSelected('AddText');"
PostBack
=
"False"
></
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Text
=
"Insert Checkboxes..."
NavigateUrl
=
"javascript:MenuItemSelected('AddChecks');"
PostBack
=
"False"
></
telerik:RadMenuItem
>
....
The menu items missing in the Page_Load code all show up fine in the page including the one I need to get rid of.
Any ideas how to work around this problem and why it is happening?