SharePoint feature corrupts page layout

August 28, 2010 · 1 minute read · sharepoint

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.

Published: 2017-07-30 20:47:37 +1000 +1000, Version: bfd8bbd