I'm using a radTabStrip menu, not multipage and at times, very random, I receive a "null is null or not an object" error when I click on a tab. I could successfully click the tab prior or after receiving the error but at times the error appears.
Here is some code for the javascript.
<
script type="text/javascript" language="javascript">
function SelectMyTab(sender, args)
{
//var multiPageID = sender.get_multiPageID();
//sender.set_multiPageID(null);
args.get_tab().select();
//sender.set_multiPageID(multiPageID);
}
function UnSelectMyTab(e)
{
var tabStrip = $find('<%= MainNav.ClientID%>');
//Find the element which the mouse is over
var destElement = e.relatedTarget || e.toElement;
if ($telerik.isDescendant(tabStrip.get_element(), destElement))
return;
var initialTab = tabStrip.findTabByText("<%= MyTab %>");
initialTab.unselect();
initialTab.selectParents();
}
</
script>
As you can see I removed the multipage references. I'm wondering if that has something to do with it.
Basically, I don't want multipage. I want the tab to load a new .aspx page when clicked, which is what is happening. I have onstates set, mouseover and mouseout states.
I need to remove this error and resolve the null reference.
In debug mode, when the error occurs it breaks here:
if
($telerik.isDescendant(tabStrip.get_element(), destElement))
My RadTabStrip looks like this:
<telerik:RadTabStrip ID="MainNav" runat="server" SelectedIndex="0"
AutoPostBack="True" Skin="MainTheme" EnableEmbeddedSkins="false"
OnClientMouseOver="SelectMyTab" onmouseout="UnSelectMyTab(event)"
ClickSelectedTab="true" UnSelectChildren="true"
ontabcreated="MainNav_TabCreated">
<Tabs>
<telerik:RadTab ID="TabHome" runat="server" Text="Home" NavigateUrl="~/Default.aspx" onmouseover="changeIt(0);" onclick="setMouseOut(0);">
<Tabs>
<telerik:RadTab ID="Tab1" runat="server" Text="Tab 1" onmouseover="this.style.cursor='hand';" onmouseout="this.style.cursor='default';" NavigateUrl="~/Tab1.aspx" />
<telerik:RadTab ID="TabSeparator1" runat="server" IsSeparator="true" Text="|" />
<telerik:RadTab ID="Tab2" runat="server" Text="Tab 2" onmouseover="this.style.cursor='hand';" onmouseout="this.style.cursor='default';" NavigateUrl="~/Tab2.aspx" />
</Tabs>
</telerik:RadTab>
<telerik:RadTab ID="TabExtended" runat="server">
<Tabs>
<telerik:RadTab ID="TabExtendedPH" runat="server" />
</Tabs>
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
Any help is much appreciated, thanks in advance for your time and consideration.