I was getting that error the other day and it was because I had runat="server' in the header. Not sure why that caused an issue but it did.