it sounds to me like you are pasting the code for the entire page, not just the insert or update record behavior.
the work flow should not include any copying from one page then pasting it to another.
If you are not using the wizard to create the pages, you should be creating the update form on your page, then applying the Up[date Record server behavior to it, I'm not sure why you are Copying code from one page to another, but that is likely the source of the page doubling and also of the headers already sent error.