How to do the following but with code? my page name is actnow.aspx
click the "Site Actions" menu bar, select "Site Settings" and then click on "Modify All Site Settings". Under the "Look and Feel" column is a link called "Welcome Page".
|
How to do the following but with code? my page name is actnow.aspx click the "Site Actions" menu bar, select "Site Settings" and then click on "Modify All Site Settings". Under the "Look and Feel" column is a link called "Welcome Page". |
|||||||
|
|
What you want is Combine this with Lori's suggestion for doing it in PowerShell. |
|||
|
|
|
There is a powershell script for this here: http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010setup/thread/ecc0b2e4-8661-420a-bdf5-d7af13567be2. If you are wanting to do this for multiple webs that have the same file name in their pages libraries, I'm sure you could modify this script to enumerate through those sites and perform the same action. |
|||
|
|
|
Assuming "web" is an SPWeb for the site you're trying to change:
See http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfolder.welcomepage.aspx |
|||||||||||
|
|
I would recommend using RootFolder.WelcomePage. However, there seems to be a strange issue where you have to actually get the Rootfolder object to do stuff, unless it won't be updated. Alas, this doesn't work:
But this will:
|
|||
|