An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[NullReferenceException: Object reference not set to an instance of an object.] Telerik.Sitefinity.Modules.Pages.DraftProxyBase.GetPageUrlByNodeId(String nodeId) +110 Telerik.Sitefinity.Modules.Pages.DraftProxyBase.get_CancelUrl() +469 Telerik.Sitefinity.Modules.Pages.DraftProxyBase.CreateChildControls(Page page) +1281 Telerik.Sitefinity.Modules.Pages.PageDraftProxy.CreateChildControls(Page page) +42 Telerik.Sitefinity.Web.PageEditorRouteHandler.ApplyLayoutsAndControls(Page page, RequestContext requestContext) +350 Telerik.Sitefinity.Web.RouteHandler.InitializeContent(Page handler, RequestContext requestContext) +333 Telerik.Sitefinity.Web.RouteHandler.Handler_Load(Object sender, EventArgs e) +561 System.Web.UI.Control.OnLoad(EventArgs e) +91 System.Web.UI.Control.LoadRecursive() +74 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
01.
void
AddPermissionsToCustomPage()
02.
03.
PageManager pm = PageManager.GetManager();
04.
RoleManager rm = RoleManager.GetManager();
05.
06.
//get the custom page
07.
PageNode customPage = pm.GetPageNodes()
08.
.Where(
09.
node => node.Title ==
"CustomPage"
)
10.
.FirstOrDefault();
11.
12.
//get the custom role
13.
Role pageEditor = rm.GetRole(
"PageEditor"
);
14.
15.
if
(customPage !=
null
16.
17.
//make sure permission inheritance for this page
18.
//is broken. Otherwise specific permissions are
19.
//not effective.
20.
pm.BreakPermiossionsInheritance(customPage);
21.
22.
//check if a permission for the custom role already
23.
//exists for this page
24.
Permission pageEditorPermission =
25.
customPage.GetActivePermissions()
26.
.Where(permission =>
27.
permission.PrincipalId == pageEditor.Id)
28.
29.
30.
//if the permission doesn't exist,
31.
//we need to created it and attach it to the page
32.
(pageEditorPermission ==
33.
34.
pageEditorPermission = pm
35.
.CreatePermission(
36.
SecurityConstants.Sets.Pages.SetName,
37.
customPage.Id,
38.
pageEditor.Id);
39.
40.
customPage.Permissions.Add(
41.
pageEditorPermission);
42.
43.
//grant the custom role the option to modify
44.
//(or any other desired permission)
45.
pageEditorPermission.GrantActions(
true
,
46.
SecurityConstants.Sets.Pages.EditContent);
47.
48.
//Done.
49.
pm.SaveChanges();
50.
51.
The specified role "Administrators" already exists. 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: System.Configuration.Provider.ProviderException: The specified role "Administrators" already exists. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [ProviderException: The specified role "Administrators" already exists.] Telerik.Sitefinity.Security.Data.OpenAccessRoleProvider.CreateRole(Guid id, String roleName) +447 Telerik.Sitefinity.Web.UI.Backend.AdministratorPane.EnsureRole(RoleDataProvider roles, RoleInfo role) +379 Telerik.Sitefinity.Web.UI.Backend.AdministratorPane.DoWork() +95 Telerik.Sitefinity.Web.UI.Backend.StartupWizard.ProcessWizardStep(InternalWizard wizard, Int32 stepIndex, IStartupWizardStepPane& currentPane) +89 Telerik.Sitefinity.Web.UI.Backend.StartupWizard.wizard_FinishButtonClick(Object sender, InternalWizardNavigationEventArgs e) +84 Telerik.Sitefinity.Web.UI.Backend.InternalWizard.OnFinishButtonClick(InternalWizardNavigationEventArgs e) +92 Telerik.Sitefinity.Web.UI.Backend.InternalWizard.OnBubbleEvent(Object source, EventArgs e) +512 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +121 System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +161 System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9997462 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1738
I created earlier 1 project i forgot password and everything. So i tried to create new one getting error, could you please let me know that how and what i want to do. it's very urgent work me live.