views:

7537

answers:

2

On several occations, I have faced the situation that the default.aspx page on a Site doesn't work. More specifically, a reference to a WebPart and/or Control is throwing a error because the assembly is not found. Fine, you just fire up the dreaded SharePoint Designer and remove the dependency line. However, if I wanted to use this method when not having SharePoint Designer, how could this be done?

EDIT: Removing the web part using the "?contents=1" web part management page didn't help in my case. The <%@Register tag was still there and had to be removed using SharePoint Designer.

+2  A: 

Go to view all content of the site (http://yourdmain.sharepoint/sitename/%5Flayouts/viewlsts.aspx). Select the document library "Pages" (the "Pages" library are named based on the language you created the site in. I.E. in norwegian the library is named "Sider"). Download the default.aspx to you computer and fix it (remove the web part and the <%Register tag). Save it and upload it back to the library (remember to check in the file).

EDIT:

ahh.. you are not using a publishing site template. Go to site action -> site settings. Under "site administration" select the menu "content and structure" you should now see your default.aspx page. But you cant do much with it...(delete, copy or move)

workaround: Enable publishing feature to the root web. Add the fixed default.aspx file to the Pages library and change the welcome page to this. Disable the publishing feature (this will delete all other list create from this feature but not the Pages library since one page is in use.). You will now have a new default.aspx page for the root web but the url is changed from sitename/default.aspx to sitename/Pages/default.aspx.

workaround II Use a feature to change the default.aspx file. The solution is explained here: http://wssguy.com/blogs/dan/archive/2008/10/29/how-to-change-the-default-page-of-a-sharepoint-site-using-a-feature.aspx

Tomso
Nope, sorry. The default.aspx for the root web is not stored in any Document Library named Pages.
Magnus Johansson
That publishing workaround would probably work for a MOSS setup, but not for SharePoint. And changing the homepage URL is not desired. But thanks so much for your ideas.
Magnus Johansson
Found a nice solution to change the default.aspx (using features and C# code). http://wssguy.com/blogs/dan/archive/2008/10/29/how-to-change-the-default-page-of-a-sharepoint-site-using-a-feature.aspx
Tomso
@Tomso: Interesting, although it was more work than I hoped for. But your answer is the best so far. Make it an answer instead of a comment, and I will accept it.
Magnus Johansson
A: 

You can always use Sharepoint Solution Generator to create a project and edit in VS2008.

You can find the Generator along with Sharepoint Developer tools.

v3ga
I'm not sure I follow you. How could the Solution Generator help me modify the default.aspx file?
Magnus Johansson