Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Deleting IPage C#?

$
0
0
Thanks for your help.

I solved my page deletion by using this code below and now the page dont exists anymore in the database tables :)
private void DeletePage(IPage page)
        {
            using (TransactionScope transactionScope = TransactionsFacade.CreateNewScope())
            {
                //cultures
                List<CultureInfo> cultures = DataLocalizationFacade.ActiveLocalizationCultures.ToList();
                cultures.Remove(page.DataSourceId.LocaleScope);

                //page
                page.DeletePageStructure();
                ProcessControllerFacade.FullDelete(page);

                //complete
                transactionScope.Complete();
            }
        }

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>