currentNodeURL = currentNode.Url error in revision history

Posted by Community Admin on 04-Aug-2018 10:18

currentNodeURL = currentNode.Url error in revision history

All Replies

Posted by Community Admin on 12-Feb-2013 00:00

Hello,

Having a problem when accessing the page revision history. Essentially I have a custom extension of the navigation module which will check the following:

if (!this.IsPostBack)
            
                //in preview and view mode
                if (!this.IsDesignMode())
                

                    //if page is selected then expand node
                    //get the current node of the menu
                    SiteMapNode currentNode = Telerik.Sitefinity.Web.SiteMapBase.GetCurrentProvider().CurrentNode;
                    //get the url of the current node.
                    currentNodeURL = currentNode.Url;
                    //disable animation of the control, as not usable as per UX digital team.
                    RTV1.CollapseAnimation.Type = Telerik.Web.UI.AnimationType.None;
                

Although when going to a page and checking a previous version, I get 'Object reference not set to an instance of an object.

' when hitting the line ' currentNodeURL = currentNode.Url;'.

Any suggestions how to fix this or go around it? It is quite important that the users can see the correct page with the correct version of the navigation item.

Thanks.

Posted by Community Admin on 12-Feb-2013 00:00

Think this might solve it...

if (!this.IsDesignMode())
                
                    if (HttpContext.Current.Items["versionpreview"] != null && (bool)HttpContext.Current.Items["versionpreview"] != true)
                    
                        //if page is selected then expand node
                        //get the current node of the menu
                        SiteMapNode currentNode = Telerik.Sitefinity.Web.SiteMapBase.GetCurrentProvider().CurrentNode;
                        //get the url of the current node.
                        currentNodeURL = currentNode.Url;
                        //disable animation of the control, as not usable as per UX digital team.
                        RTV1.CollapseAnimation.Type = Telerik.Web.UI.AnimationType.None;
                        //forcing the CSS class, otherwise user can change it through control panel.
                        RTV1.CssClass = "RadTreeView";
                    
                   

                

This thread is closed