Wednesday, March 9, 2016

Visual Studio and Auto-Format of SharePoint aspx

I was working on an aspx layout page for SharePoint and foolishly, it would appear, selected 'Format Document' from the Edit > Advanced fly out in VS 2015. Deploying the layout template stopped working and it transpired that the reason was because of the 'Format Document' command.

Despite both SharePoint and Visual Studio being MS products and .aspx a MS file extension, the command in VS breaks it. Nice work!

So what happened?

Well, it seems that formatting the document modifies the casing of certain aspx tags and turns

<asp:Content ContentPlaceHolderId=

into

<asp:content contentplaceholderid=

And that, it seems is not liked by SharePoint. The solution is a quick search and replace (be careful with that) and the layout works like it always did. 

No comments:

Post a Comment