404 on all pages after editing master page in SharePoint desinger

January 15, 2009

I needed to make avery small change to a master page on a MOSS publishing based website yesterday, so opened up the file using SharePoint designer, saved my changes and went to the site to review and check all was Ok – I was greeted with SharePoints 404 not found page. Hmmm…not ideal!

After trying a few more pages I decided to enable the stack trace and switch off custom errors (In web.config), so I could get a better idea of what was going on – Hopingthis would tell me exactly what was missing. (I knew the pages were there, as I could see them in the SharePoint admin site).

Enabling verbose errors didnt help much – This simply gave me a slightly less friendly 404 page. I then viewed the master page directly – This time, I saw that ‘welcome.ascx’ was missing. Having checked that this was in place, I decided to check the references to the control on the master page. It took me a while, but I eventually found the problem – SharePoint designer had removed the tilde character that normally precedes the path to the control. The actual reference should have been something like this:

<%@ Register TagPrefix=”wssuc” TagName=”Welcome” src=”~/_controltemplates/Welcome.ascx” %>

After adding the tilde character back in (using notepad) and uploading via SharePoint admin, all was good again!

Just another little oddity to remember when working with SharePoint! 🙂


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: