SharePoint feature corrupts page layout

Something that I've come across a few times when working on SharePoint/ MOSS 2007 features. When importing a Page Layout the ASPX some times becomes corrupt. You end up with additional HTML inserts once it's been imported into SharePoint.

The corruption is in the form of HTML tags, outside the last </asp:Content> tag.

Well it turns out that the problem is caused when you import an ASPX that has a </asp:content> tag it'll happen. Did you notice the problem?

That's right, if you have a lowercase c then it'll import corrupt. Let me show the problem again, highlighted this time: </asp:content>

All you need to do is ensure that that has a capital letter, so the tag is </asp:Content> and it's all good again.

The most common cause of this happening is doing a format-document within Visual Studio on the ASPX when it is in the features class-library project. Visual Studio doesn't handle the ASPX file correctly, and formats it as a raw XHTML file, which dictates that the XHTML tags need to be in all lowercase.

sharepoint
Posted by: Aaron Powell
Last revised: 28 Aug, 2010 04:49 AM History

Comments

28 Aug, 2010 10:12 AM

Yes, it's a well-known issue with SharePoint 2007 (not sure about 2010 though) that caused a lot of frustration to our team when SharePoint 2007 was released. As a professional developer and architect, I can't believe the SharePoint team even considered the option of physically modifying templates.

I find things like this extremely offensive.

No new comments are allowed on this post.