currentNodeURL = currentNode.Url error in revision history
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.
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";