You should only load the contents of page B inside the contentPane, excluding the headers and the body tag.
This is done by setting extractContent to true :
<div id="foo" data-dojo-type="dojox/layout/ContentPane" data-dojo-props="renderStyles:true, executeScripts:true, extractContent:true"></div>
The styling must be done in your page A's CSS.