1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / currentNodeURL = currentNode.Url error in revision history

currentNodeURL = currentNode.Url error in revision history

2 posts, 0 answered
  1. Ricardo
    Ricardo avatar
    29 posts
    Registered:
    06 Nov 2012
    12 Feb 2013
    Link to this post

    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.

  2. Ricardo
    Ricardo avatar
    29 posts
    Registered:
    06 Nov 2012
    12 Feb 2013
    Link to this post

    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";
                        }
                       

                    }

2 posts, 0 answered