views:

151

answers:

2

I'm trying to edit a legacy wss3 sharepoint site.

Messing around with a 700+ code lines aspx page I got a "The server tag is not well formed." error on sharepoint and The ?content=1 trick does not work.

Anyone has a tip on how to get to the line that's causing the problem? I'm expecting something like the aspnet ysod, at least that's usefull.

If it's worth something, I have access to the actual server.

Update: I know the error is because I screwed up the markup, as ArenB kindly points out. What I would like to get to, is to a hint on where on the 700 lines is the mistake.

Update 2: I found a workarround and posted it as an answer, but the question is still open waiting for someone to give an answer on how to get a more descriptive error message.

+1  A: 

Server Tag is not well formed means you've got a bad tag. I.e:

<asp:Label id="myLabel" runat="server"
    Stuff!
</asp:Label>

Notice the missing > in the top part of the tag

The other way this could happen is if you meant to make a terminated tag <tag /> but forgot the / which leaves you with a missing end tag.


  • As for locating the line, use a diff mechanism to see the lines you modified and try to pinpoint the bad tag.
  • Or you could run an xml validator on the code, although asp may get quirky with a vanilla xml validator.
Aren
Oh, I think I din't expressed myself right, sorry. I know that this problem is because i screwed up the markup. What I want is to get a hint in *where* the error is in the file, because I edited a bunch of things.
David Lay
This works giving 2 preconditions: 1)I have the previous version and 2)the edits where not so many. As we know, sharepoint is not known for it's friendliness with source control, and I went nuts with the edits. :(
David Lay
+1  A: 

Ok, I figured out a manual way that may be useful to somebody, but it's not ideal either.

First, grab the code of the aspx page and paste it on another file (as a backup). Then, remove WebPart by WebPart, then WebPartZones and then any other possible server-side markup until the page stops breaking. This way, you will at least know where the error is located.

For me, this time, was a WebPartZone which had two attributes together, with no spaces in betweeen. This kind of errors can be very tricky.

I'm never doing this crazy barbarian hacking on a aspx sharepoint page again.

David Lay
"I'm never doing this crazy barbarian hacking on a aspx sharepoint page again." - That's not the first time you're going to find yourself saying that!
zincorp