Fluent API pagesfacade null? - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Fluent API pagesfacade null?

  • Fluent API pagesfacade null?
  • I created a new ASPX page in my project, with this code in page_load:

    int result;
    .Where(p => p.Page != null && String.IsNullOrEmpty(p.Page.MasterPage))
    .Count(out result);

    Edit: Nevermind. Still getting used to a web application after depending on the JIT for so long. Works fine.
  • However! I'm getting an exception from this piece of code. The page should be accessible by everyone according to the permissions.

                .Where(p => p.IsBackend == false && p.Page != null && p.Page.Template == null)
                .ForEach(page => page.NodeType = NodeType.Group)


    Server Error in '/' Application.
    You are not allowed to modify this page: Landing Pages
    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: Telerik.Sitefinity.Security.SecurityDemandFailException: You are not allowed to modify this page: Landing Pages
    Source Error:
    Line 16:            App.WorkWith().Pages()
    Line 17:                .Where(p => p.IsBackend == false && p.Page != null && p.Page.Template == null)
    Line 18:                .ForEach(page => page.NodeType = NodeType.Group)
    Line 19:                .SaveChanges();
    Line 20:       
    Source File: C:\webs\www.connectionsacademy.com\2011\_dev\default.aspx.cs    Line: 18
    Stack Trace:
    [SecurityDemandFailException: You are not allowed to modify this page: Landing Pages]
       Telerik.Sitefinity.Modules.CheckModifyPermissionsCallHandler.Invoke(EventHandlerArgs args) +403
       Telerik.Sitefinity.PropertyEventContainer.FireEvents(IDataItem item, String porpertyName, Object value, IList`1 eventHandlersCollection) +348
       Telerik.Sitefinity.Pages.Model.PageNode.set_NodeType(NodeType value) +73
       SitefinityWebApp.dev.Default.<Page_Load>b__0(PageNode page) in C:\webs\www.connectionsacademy.com\2011\_dev\default.aspx.cs:18
       Telerik.Sitefinity.Fluent.Pages.PagesFacade.ForEach(Action`1 action) +102
       SitefinityWebApp.dev.Default.Page_Load(Object sender, EventArgs e) in C:\webs\www.connectionsacademy.com\2011\_dev\default.aspx.cs:16
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
       System.Web.UI.Control.LoadRecursive() +71
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3048
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

  • Hello,

    Can you please give us some additional information about the specific scenario when the below exception occurs? Also a screenshot of the mentioned page's permissions might help us track the possible cause of the issue (please note that the page might have View permissions set to everyone, but the exception concerns Modify permissions set which by default are not set to Everyone). Looking  forwards to your reply.

    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Can you please help me to export my page contents to a pdf in sitefinity 5