More in this section
Forums / Developing with Sitefinity / You cannot change a value of an object that is not in transaction.

You cannot change a value of an object that is not in transaction.

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 1 answered
  1. Sachin
    Sachin avatar
    18 posts
    10 Nov 2010
    25 Apr 2011
    Link to this post

    I am trying to change the "Show in Navigation" property of one of the section of website programmatically but I am getting this error:

    You cannot change a value of an object that is not in transaction.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: Nolics.ORMapper.Base.NolnetException: You cannot change a value of an object that is not in transaction.

    Source Error:

    Line 33:         {
    Line 34: ICmsPage agentPage = (ICmsPage) Manager.GetPage(agentNode.PageID);
    Line 35: agentPage.Navigable = true;
    Line 36: Manager.SavePage(agentPage);
    Line 37: }

    Here is my code.

    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using Telerik.Web.UI;
    using Telerik.Cms;
    using Telerik.Cms.Web;

    public partial class userControls_sitemap : System.Web.UI.UserControl
        protected void Page_Load(object sender, EventArgs e)
            SiteMapRadTreeView.DataSource = new SiteMapDataSource();

        public void showAllAgentsInSitemap()
            CmsManager Manager = new CmsManager();
            CmsSiteMapNode parentNode = (CmsSiteMapNode) SiteMap.Provider.FindSiteMapNode("~/MovingCompanies.aspx");        
            IList allAgents = parentNode.ChildNodes;
            foreach (CmsSiteMapNode agentNode in allAgents)
                ICmsPage agentPage = (ICmsPage) Manager.GetPage(agentNode.PageID);             
                agentPage.Navigable = true;

    What is going wrong here? I checked other threads having similar issue but it didn't help. I am using Sitefinity 3.7.2022.2. Thanks.

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    26 Apr 2011
    Link to this post
    Hello Sachin,

    Set the second parameter of GetPage - to true. This will put the page into a transaction.

    All the best,
    Ivan Dimitrov
    the Telerik team

2 posts, 1 answered