London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Try use the .GetPageDirectory(true) on the PageData-object.
http://sdk.episerver.com/library/cms5/html/M_EPiServer_Core_PageData_GetPageDirectory.htm
Hi,
PageData newComment = DataFactory.Instance.GetDefaultPageData(blogdirpage.PageLink, PersonalBlogType, AccessLevel.NoAccess);
newComment.PageName = txtCreateBlog.Text;
DataFactory.Instance.Save(newComment, EPiServer.DataAccess.SaveAction.Publish, AccessLevel.NoAccess);
string virtualPathFromFolderId = VirtualPathUtility.Combine(pageDirectoryRootVirtualPath, VirtualPathUtility.AppendTrailingSlash(folderId.ToString()));
string pageDirectoryRootVirtualPath = VirtualPathHandler.PageDirectoryRootVirtualPath;
IPageDirectory ipageDirectory = HostingEnvironment.VirtualPathProvider.GetDirectory(pageDirectoryRootVirtualPath) as IPageDirectory;
UnifiedDirectory directory = HostingEnvironment.VirtualPathProvider.GetDirectory(virtualPathFromFolderId) as UnifiedDirectory;
if (directory == null)
{
directory = ipageDirectory.CreateSubdirectory(virtualPathFromFolderId, newComment);
}
When i tried to create a pagefolder using the above code i am getting a error message like "You are not authorized to create directory" .How can i solve this error
Thanks in Advance
SADIK R