Home > Blogs > Blog Post

Updating SPWeb.RootFolder.WelcomePage not working!

by Mark Jones | Jan 24, 2012

I was recently trying to programmatically set the default (welcome) page of a team site, but my changes weren't taking effect. As it turns out, this code:

contextWeb.RootFolder.WelcomePage = rootFolder.Name + "/" + wikiFileName;
contextWeb.RootFolder.Update();
 
 

Needs to be changed to work with a local copy of an SPFolder. I haven't used reflector but, i am guessing that on the 'getter' for SPWeb.RootFolder we are given a complete new instance every time. So the code now needs to be this - (thanks SharePoint):

SPFolder folder = context.Web.RootFolder;
folder.WelcomePage = rootFolder.Name + "/" + wikiFileName;
folder.Update();

Compliance using DocRead

DocRead logoDocRead for SharePoint can help you manage policy compliance by:

  • Targeting documents or policies at specific groups of users
  • Allowing a specific amount of time for users to confirm agreement 
  • Sending email reminders when policy compliance is overdue
  • Users self-certify that they have read and fully understood the policy details
  • Securely storing records of confirmed policy acceptance
  • Monitoring the user acceptance of policies via a reporting suite
  • Providing detailed reading reports and statistics
  • Report drill through to show who has not accepted the policy
  • Automatically sending historic compliance tasks and policies to new users when they are added to a group
  • Bringing policy compliance requests immediately to users attention when they log on

DocRead is simple to install and configure. It seamlessly integrates with SharePoint and can be added to any existing SharePoint site.

To find out more, visit the DocRead product site.


blog comments powered by Disqus