Nishand's Blog

Welcome to my personal blog, All the information in this bogs is my ideas,findings and thoughts on .Net, Asp.Net and SharePoint.
ALL POSTING ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND

How to set SPFolder.WelcomePage property?

Some SharePoint objects needs an instance to work perfectly, one example is here;

Sample 2 works however the Sample 1 doesn't :)

Sample1

SPSite site = new SPSite("http://server:100/sites/InternetSite/");

SPWeb web = site.OpenWeb();

web.RootFolder.WelcomePage=”TestWiki/Hello.aspx”;

web.RootFolder.Update();

Sample 2

SPSite site = new SPSite("http://server:100/sites/InternetSite/");

SPWeb web = site.OpenWeb();

SPFolder folder = web.RootFolder;

folder.WelcomePage = "TestWiki/Hello1.aspx";

folder.Update();

Published Sunday, May 20, 2007 9:38 PM by nishandv

Comments

No Comments
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker