most likely a malformed server tag or server script in either the layout.master file or a custom usercontrol somewhere, sometimes using things like <%= %> in the wrong place can cause this kind of thing
If you are using the same files in both working and non working perhaps some file got corrupted and malformed during upload. Maybe try deploy them again.
Hope it helps,
Joe