I have searched the internet and all of TheScripts, and apparently I'm the first person in the world to ever have this problem, or maybe just the last to figure out what was causing it.
All my databound server controls are adding extra CR/LF and UTF-8 byte order marks at random locations to their output. Most of the time these extra sequences fall between tags, and so are only visible if the page source is viewed. However, sometimes they fall within literal text, adding extra line breaks to the form, and every so often one will split a tag, so an href="myform.aspx" is written to the output stream as href="myf(CR)(LF)(BOM)orm.aspx", which of course makes the hyperlink return a 404.
Has anyone else, anywhere, even heard of this problem before? Anyone have any ideas what could be causing it?
Here's an example of one of the controls suffering this issue:
[HTML]
<asp:repeater id="rptrMyLinks" runat="server" Visible="true">
<ItemTemplate>
<a href='<%= Request.ApplicationPath %>/Links/<%# Container.DataItem %>' target="_blank"><%# Container.DataItem %></a><br>
</ItemTemplate>
</asp:repeater>
[/HTML]
It's about as simple as it can get, but it still is suffering from this problem.